Forums > MaxMSP

key combinations

May 4, 2006 | 6:05 pm

hi guys,
i’m trying to get a bang only if a particular key combination is pressed simultaneously on the computer keyboard…

i’m using the 2 "key" objects and a select after each one…

how can i generate a bang only if the 2 select bangs happens toghether?

thanx

lalo


May 4, 2006 | 8:14 pm

I’m a noob, so this might be a ridiculous solution, but I find the following to be very helpful, as you can use a [route] with the ascii code as arguments, so you simply swap out the args to get another key combo. (my lord I had to look at the [match] help file a million times to get it! "why does it only have one inlet", hehe.

Anyway, if anyone has a more optimized and flexible way of doing this I would love to hear about it.

Andreas

->two depressions:

#P window setfont "Sans Serif" 9.;
#P number 143 114 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 184 216 164 0;
#P window linecount 1;
#P newex 184 185 50 9109513 match 1 1;
#P newex 184 152 65 9109513 route 97 115;
#P newex 234 113 50 9109513 pack 1 0;
#P newex 184 113 42 9109513 pack 1 1;
#P newex 234 84 51 9109513 keyup;
#P newex 184 84 38 9109513 key;
#P window linecount 3;
#P comment 252 151 100 9109513 < - Keys "a" and "d" depressed at the same time.;
#P connect 1 0 8 0;
#P connect 1 0 3 0;
#P fasten 4 0 5 0 239 142 189 142;
#P connect 3 0 5 0;
#P fasten 5 1 6 0 216 178 189 178;
#P connect 5 0 6 0;
#P connect 6 0 7 0;
#P connect 2 0 4 0;
#P window clipboard copycount 9;


May 4, 2006 | 8:42 pm

here’s one possibility:

Roby

#P window setfont "Sans Serif" 9.;
#P number 113 237 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 168 175 27 196617 t b i;
#P button 62 269 42 0;
#P newex 62 237 32 196617 sel 2;
#P newex 62 208 133 196617 +;
#P toggle 168 155 15 0;
#P window setfont "Sans Serif" 12.;
#P comment 151 153 13 196620 s;
#P window setfont "Sans Serif" 9.;
#P message 168 114 14 196617 0;
#P message 144 114 14 196617 0;
#P newex 144 82 59 196617 sel 97 115;
#P newex 144 55 40 196617 keyup;
#P message 86 114 14 196617 1;
#P message 62 114 14 196617 1;
#P toggle 62 156 15 0;
#P newex 62 82 59 196617 sel 97 115;
#P newex 62 55 38 196617 key;
#P window setfont "Sans Serif" 12.;
#P comment 44 154 13 196620 a;
#P connect 12 0 13 0;
#P connect 12 0 16 0;
#P connect 1 0 2 0;
#P connect 2 0 4 0;
#P connect 2 1 5 0;
#P connect 7 1 9 0;
#P connect 7 0 8 0;
#P connect 6 0 7 0;
#P connect 4 0 3 0;
#P connect 5 0 11 0;
#P connect 8 0 3 0;
#P connect 9 0 11 0;
#P connect 3 0 12 0;
#P connect 13 0 14 0;
#P connect 11 0 15 0;
#P connect 15 1 12 1;
#P connect 15 0 12 0;
#P window clipboard copycount 17;


May 8, 2006 | 7:22 pm

umm… maybe you know this, but there are only certain keys which you can press simultaneously on a keyboard; it works like a monophonic synth. "a, s, d,f" can, for example, only be pressed separately. "cntrl, a, alt", however, are on different matrix inputs.

good luck


May 8, 2006 | 9:08 pm

Dat ain’t necessarily so.

Most keyboards support simultaneous (or overlapping) keystrokes to a
limited extent. The earliest Macs supported up to three simultaneous
non-modifier keys, and newer keyboards generally handle five or more.

All of this is over and above the modifiers (shift, option/alt,
command [on Mac], caps lock, control).

Lalo is using the Forum, so I can’t tell whether he’s on XP or Mac OS
(mail header reveal the OS you’re using even if you forget to include
this !vital! piece of information). I’m not 100% sure that Windows
hardware supports multiple non-mod keystrokes, but it would be pretty
braindead if it didn’t.

– P.

—-

Li’l David was small, but oh my,
(Li’l David was small, but oh my)
He slew great Goliath
Who lay down and dieth.
Li’l David was small, but oh my!


May 9, 2006 | 11:18 am

On 8 May 2006, at 22:08, Peter Castine wrote:

>> "a, s, d,f" can, for example, only be pressed separately. "cntrl,
>> a, alt", however, are on different matrix inputs.
>
> Dat ain’t necessarily so.

Indeed – on my PowerBook, I can type a-s-d-f in sequence, keeping the
keys held down, and they all register. I just tried it on a generic
(*) USB-or-mini-DIN keyboard attached to a Mac mini and it’s the
same. Of course, these aren’t modifiers; all that matters is the key-on.

(*) generic-ish: it’s one of those sealed, soft, foldable rubber
keyboards that rolls up for carrying between gigs, and is
surprisingly pleasant, if odd, to type on.

– N.

nick rothwell — composition, systems, performance — http://
http://www.cassiel.com



dan
May 9, 2006 | 7:16 pm

On the same subject, I have a game controller (NES –> USB via the
Retropad* mod) with 8 binary buttons. I’d like to use the keys
individually *and* in combination, e.g., pressing and releasing "A"
does one thing and "A" + "up" does something different *without*
triggering the "A" action. I’ve been experimenting with different
combinations of route, select, match, thresh, trigger, and arithmetic
objects (and looking through the Max tutorials to see if I’d forgotten
something) but I can’t wrap my head around this problem. Is it time
for a big [if] object? Does this look like a job for Javascript?

FYI, each button on the controller sends a controller number, e.g., 4
for "A", followed by a 1 when pressed and a 0 when released.

thanks,
dan

* http://www.retrousb.com/


***
http://danwinckler.com
http://share.dj

http://gunshowimprov.com


May 9, 2006 | 7:45 pm

Quote: dan wrote on Tue, 09 May 2006 21:16
—————————————————-
> On the same subject, I have a game controller (NES –> USB via the
> Retropad* mod) with 8 binary buttons. I’d like to use the keys
> individually *and* in combination, e.g., pressing and releasing "A"
> does one thing and "A" + "up" does something different *without*
> triggering the "A" action.

Well the main thing would be that the patch isn’t a mind-reader, so you initially lose the ability to use immidiate button-A-depression. You could use quickthresh to detect how many buttons are being pressed and if just 1 (using [zl len]->[split] or something), then fire that straight away, otherwise trigger a command for the combo. that would be non-real-time: there’d be a lag corresponding to the threshold time.

For instant use you’d have to rely on your button release to trigger. I’ll see if I can cook up a patch for you, since this is quite in line with what I’m working with right now

Andreas
- a[at]thecovertoperators.com


May 9, 2006 | 8:53 pm

These types of problems are well-suited to bitwise solutions. I’m
integrating, but you could do it with a list of 0′s and 1′s and vexpr.

Peter McCulloch

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P hidden newex 530 17 66 196617 loadmess 73;
#P hidden newex 529 215 60 196617 loadmess 1;
#P newex 412 404 127 196617 ==;
#P number 412 380 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 412 428 30 0;
#P newex 412 326 90 196617 r Buttons.Encoded;
#P comment 653 246 26 196617 128;
#P comment 635 246 20 196617 64;
#P comment 617 246 20 196617 32;
#P comment 600 246 20 196617 16;
#P comment 583 246 14 196617 8;
#P comment 566 246 14 196617 4;
#P comment 547 246 14 196617 2;
#P newex 412 356 127 196617 &;
#N vpatcher 20 74 620 474;
#P window setfont "Sans Serif" 9.;
#P newex 50 108 67 196617 mxj list.sum;
#P newex 250 61 153 196617 loadmess 1 2 4 8 16 32 64 128;
#P newex 50 83 210 196617 vexpr $i1*$i2;
#P newex 50 50 138 196617 pak 0 0 0 0 0 0 0 0;
#P inlet 50 30 15 0;
#P inlet 68 30 15 0;
#P inlet 86 30 15 0;
#P inlet 104 30 15 0;
#P inlet 122 30 15 0;
#P inlet 140 30 15 0;
#P inlet 158 30 15 0;
#P inlet 176 30 15 0;
#P outlet 50 130 15 0;
#P connect 8 0 9 0;
#P connect 9 0 10 0;
#P connect 10 0 12 0;
#P connect 12 0 0 0;
#P connect 7 0 9 1;
#P connect 6 0 9 2;
#P connect 5 0 9 3;
#P connect 4 0 9 4;
#P connect 3 0 9 5;
#P connect 2 0 9 6;
#P connect 1 0 9 7;
#P connect 11 0 10 1;
#P pop;
#P newobj 529 289 138 196617 p BitMask;
#P number 529 315 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 655 265 15 0;
#P toggle 637 265 15 0;
#P toggle 619 265 15 0;
#P toggle 601 265 15 0;
#P toggle 583 265 15 0;
#P toggle 565 265 15 0;
#P toggle 547 265 15 0;
#P toggle 529 265 15 0;
#P comment 529 246 14 196617 1;
#P window setfont "Sans Serif" 18.;
#P window linecount 3;
#P comment 376 240 141 196626 Look for relative matches;
#P toggle 413 181 30 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 413 119 90 196617 r Buttons.Encoded;
#P comment 654 39 26 196617 128;
#P comment 636 39 20 196617 64;
#P comment 618 39 20 196617 32;
#P comment 601 39 20 196617 16;
#P comment 584 39 14 196617 8;
#P comment 567 39 14 196617 4;
#P comment 548 39 14 196617 2;
#P newex 29 258 90 196617 s Buttons.Encoded;
#P newex 155 161 52 196617 r button8;
#P newex 137 143 52 196617 r button7;
#P newex 119 125 52 196617 r button6;
#P newex 101 107 52 196617 r button5;
#P newex 83 89 52 196617 r button4;
#P newex 65 71 52 196617 r button3;
#P newex 47 53 52 196617 r button2;
#P newex 29 35 52 196617 r button1;
#P newex 413 149 127 196617 ==;
#N vpatcher 20 74 620 474;
#P window setfont "Sans Serif" 9.;
#P newex 50 108 67 196617 mxj list.sum;
#P newex 250 61 153 196617 loadmess 1 2 4 8 16 32 64 128;
#P newex 50 83 210 196617 vexpr $i1*$i2;
#P newex 50 50 138 196617 pak 0 0 0 0 0 0 0 0;
#P inlet 50 30 15 0;
#P inlet 68 30 15 0;
#P inlet 86 30 15 0;
#P inlet 104 30 15 0;
#P inlet 122 30 15 0;
#P inlet 140 30 15 0;
#P inlet 158 30 15 0;
#P inlet 176 30 15 0;
#P outlet 50 130 15 0;
#P connect 8 0 9 0;
#P connect 9 0 10 0;
#P connect 10 0 12 0;
#P connect 12 0 0 0;
#P connect 7 0 9 1;
#P connect 6 0 9 2;
#P connect 5 0 9 3;
#P connect 4 0 9 4;
#P connect 3 0 9 5;
#P connect 2 0 9 6;
#P connect 1 0 9 7;
#P connect 11 0 10 1;
#P pop;
#P newobj 29 210 138 196617 p BitMask;
#P number 29 236 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 155 186 15 0;
#P toggle 137 186 15 0;
#P toggle 119 186 15 0;
#P toggle 101 186 15 0;
#P toggle 83 186 15 0;
#P toggle 65 186 15 0;
#P toggle 47 186 15 0;
#P toggle 29 186 15 0;
#N vpatcher 20 74 620 474;
#P window setfont "Sans Serif" 9.;
#P newex 50 108 67 196617 mxj list.sum;
#P newex 250 61 153 196617 loadmess 1 2 4 8 16 32 64 128;
#P newex 50 83 210 196617 vexpr $i1*$i2;
#P newex 50 50 138 196617 pak 0 0 0 0 0 0 0 0;
#P inlet 50 30 15 0;
#P inlet 68 30 15 0;
#P inlet 86 30 15 0;
#P inlet 104 30 15 0;
#P inlet 122 30 15 0;
#P inlet 140 30 15 0;
#P inlet 158 30 15 0;
#P inlet 176 30 15 0;
#P outlet 50 130 15 0;
#P connect 8 0 9 0;
#P connect 9 0 10 0;
#P connect 10 0 12 0;
#P connect 12 0 0 0;
#P connect 7 0 9 1;
#P connect 6 0 9 2;
#P connect 5 0 9 3;
#P connect 4 0 9 4;
#P connect 3 0 9 5;
#P connect 2 0 9 6;
#P connect 1 0 9 7;
#P connect 11 0 10 1;
#P pop;
#P newobj 530 82 138 196617 p BitMask;
#P number 530 108 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 656 58 15 0;
#P toggle 638 58 15 0;
#P toggle 620 58 15 0;
#P toggle 602 58 15 0;
#P toggle 584 58 15 0;
#P toggle 566 58 15 0;
#P toggle 548 58 15 0;
#P toggle 530 58 15 0;
#P comment 530 39 14 196617 1;
#P window setfont "Sans Serif" 18.;
#P window linecount 2;
#P comment 375 53 141 196626 Look for only exact matches:;
#P connect 23 0 12 0;
#P connect 12 0 21 0;
#P connect 21 0 20 0;
#P connect 20 0 31 0;
#P connect 24 0 13 0;
#P connect 13 0 21 1;
#P connect 25 0 14 0;
#P connect 14 0 21 2;
#P connect 26 0 15 0;
#P connect 15 0 21 3;
#P connect 27 0 16 0;
#P connect 16 0 21 4;
#P connect 28 0 17 0;
#P connect 17 0 21 5;
#P connect 29 0 18 0;
#P connect 18 0 21 6;
#P connect 30 0 19 0;
#P connect 19 0 21 7;
#P connect 61 0 53 0;
#P connect 53 0 63 0;
#P connect 63 0 64 0;
#P connect 64 0 62 0;
#P connect 39 0 22 0;
#P connect 22 0 40 0;
#P hidden connect 65 0 43 0;
#P connect 43 0 52 0;
#P connect 52 0 51 0;
#P connect 51 0 53 1;
#P connect 51 0 64 1;
#P hidden connect 66 0 2 0;
#P connect 2 0 11 0;
#P connect 11 0 10 0;
#P connect 10 0 22 1;
#P connect 44 0 52 1;
#P connect 3 0 11 1;
#P connect 45 0 52 2;
#P connect 4 0 11 2;
#P hidden connect 65 0 46 0;
#P connect 46 0 52 3;
#P hidden connect 66 0 5 0;
#P connect 5 0 11 3;
#P connect 47 0 52 4;
#P connect 6 0 11 4;
#P connect 48 0 52 5;
#P connect 7 0 11 5;
#P connect 49 0 52 6;
#P hidden connect 66 0 8 0;
#P connect 8 0 11 6;
#P connect 50 0 52 7;
#P connect 9 0 11 7;
#P window clipboard copycount 67;



dan
May 10, 2006 | 2:18 am

Wow, thanks, guys!

Andreas: For my purposes right now, going off the button release is
fine. The time difference between instantaneous (pressing A) and the
speed of my thumbs (pressing and releasing A) is negligible. I
suppose that would become a factor to consider if I wanted to make
pressing-and-holding A do something.

Peter: wow. Your patch is so hardcore — I’m not sure I understand
it. :D Right now, I don’t get what sending [loadmess 73] to the
exact matches part does. Also how would I test for just one button
getting pressed and released? Maybe I’ll understand it in the morning
when I’m fresh. I’ve pasted below what I thought might test for A
alone but it, of course, doesn’t. :)

thanks,
dan

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P hidden newex 178 341 66 196617 loadmess 73;
#P toggle 61 514 30 0;
#P newex 61 452 90 196617 r Buttons.Encoded;
#P comment 302 372 26 196617 128;
#P comment 284 372 20 196617 64;
#P comment 266 372 20 196617 32;
#P comment 249 372 20 196617 16;
#P comment 232 372 14 196617 8;
#P comment 215 372 14 196617 4;
#P comment 196 372 14 196617 2;
#P newex 61 482 127 196617 ==;
#N vpatcher 20 74 620 474;
#P window setfont "Sans Serif" 9.;
#P newex 50 108 67 196617 mxj list.sum;
#P newex 250 61 153 196617 loadmess 1 2 4 8 16 32 64 128;
#P newex 50 83 210 196617 vexpr $i1*$i2;
#P newex 50 50 138 196617 pak 0 0 0 0 0 0 0 0;
#P inlet 50 30 15 0;
#P inlet 68 30 15 0;
#P inlet 86 30 15 0;
#P inlet 104 30 15 0;
#P inlet 122 30 15 0;
#P inlet 140 30 15 0;
#P inlet 158 30 15 0;
#P inlet 176 30 15 0;
#P outlet 50 130 15 0;
#P connect 8 0 9 0;
#P connect 9 0 10 0;
#P connect 10 0 12 0;
#P connect 12 0 0 0;
#P connect 7 0 9 1;
#P connect 6 0 9 2;
#P connect 5 0 9 3;
#P connect 4 0 9 4;
#P connect 3 0 9 5;
#P connect 2 0 9 6;
#P connect 1 0 9 7;
#P connect 11 0 10 1;
#P pop;
#P newobj 178 415 138 196617 p BitMask;
#P number 178 441 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 304 391 15 0;
#P toggle 286 391 15 0;
#P toggle 268 391 15 0;
#P toggle 250 391 15 0;
#P toggle 232 391 15 0;
#P toggle 214 391 15 0;
#P toggle 196 391 15 0;
#P toggle 178 391 15 0;
#P comment 178 372 14 196617 1;
#P window setfont "Sans Serif" 18.;
#P window linecount 3;
#P user com 59 363 101 196626 14;
#K set 0 19567 28523 8294 28530 8205 27749 26228 8289 27759 28261
16141 18546 27950 11822;
#K end;
#P toggle 76 222 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 236 29 68 196617 NESRetroPad;
#P hidden newex 517 23 66 196617 loadmess 73;
#P hidden newex 516 221 60 196617 loadmess 1;
#P newex 399 410 127 196617 ==;
#P number 399 386 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 399 434 30 0;
#P newex 399 332 90 196617 r Buttons.Encoded;
#P comment 640 252 26 196617 128;
#P comment 622 252 20 196617 64;
#P comment 604 252 20 196617 32;
#P comment 587 252 20 196617 16;
#P comment 570 252 14 196617 8;
#P comment 553 252 14 196617 4;
#P comment 534 252 14 196617 2;
#P newex 399 362 127 196617 &;
#N vpatcher 20 74 620 474;
#P window setfont "Sans Serif" 9.;
#P newex 50 108 67 196617 mxj list.sum;
#P newex 250 61 153 196617 loadmess 1 2 4 8 16 32 64 128;
#P newex 50 83 210 196617 vexpr $i1*$i2;
#P newex 50 50 138 196617 pak 0 0 0 0 0 0 0 0;
#P inlet 50 30 15 0;
#P inlet 68 30 15 0;
#P inlet 86 30 15 0;
#P inlet 104 30 15 0;
#P inlet 122 30 15 0;
#P inlet 140 30 15 0;
#P inlet 158 30 15 0;
#P inlet 176 30 15 0;
#P outlet 50 130 15 0;
#P connect 8 0 9 0;
#P connect 9 0 10 0;
#P connect 10 0 12 0;
#P connect 12 0 0 0;
#P connect 7 0 9 1;
#P connect 6 0 9 2;
#P connect 5 0 9 3;
#P connect 4 0 9 4;
#P connect 3 0 9 5;
#P connect 2 0 9 6;
#P connect 1 0 9 7;
#P connect 11 0 10 1;
#P pop;
#P newobj 516 295 138 196617 p BitMask;
#P number 516 321 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 642 271 15 0;
#P toggle 624 271 15 0;
#P toggle 606 271 15 0;
#P toggle 588 271 15 0;
#P toggle 570 271 15 0;
#P toggle 552 271 15 0;
#P toggle 534 271 15 0;
#P toggle 516 271 15 0;
#P comment 516 252 14 196617 1;
#P window setfont "Sans Serif" 18.;
#P window linecount 3;
#P comment 363 246 141 196626 Look for relative matches;
#P toggle 400 187 30 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 400 125 90 196617 r Buttons.Encoded;
#P comment 641 45 26 196617 128;
#P comment 623 45 20 196617 64;
#P comment 605 45 20 196617 32;
#P comment 588 45 20 196617 16;
#P comment 571 45 14 196617 8;
#P comment 554 45 14 196617 4;
#P comment 535 45 14 196617 2;
#P newex 76 294 90 196617 s Buttons.Encoded;
#P newex 202 197 35 196617 r 0_a;
#P newex 184 179 35 196617 r 0_b;
#P newex 166 161 53 196617 r 0_start;
#P newex 148 143 57 196617 r 0_select;
#P newex 130 125 40 196617 r 0_up;
#P newex 112 107 52 196617 r 0_right;
#P newex 94 89 53 196617 r 0_down;
#P newex 76 71 46 196617 r 0_left;
#P newex 400 155 127 196617 ==;
#N vpatcher 98 212 698 612;
#P window setfont "Sans Serif" 9.;
#P newex 50 108 67 196617 mxj list.sum;
#P newex 250 61 153 196617 loadmess 1 2 4 8 16 32 64 128;
#P newex 50 83 210 196617 vexpr $i1*$i2;
#P newex 50 50 138 196617 pak 0 0 0 0 0 0 0 0;
#P inlet 50 30 15 0;
#P inlet 68 30 15 0;
#P inlet 86 30 15 0;
#P inlet 104 30 15 0;
#P inlet 122 30 15 0;
#P inlet 140 30 15 0;
#P inlet 158 30 15 0;
#P inlet 176 30 15 0;
#P outlet 50 130 15 0;
#P connect 8 0 9 0;
#P connect 9 0 10 0;
#P connect 10 0 12 0;
#P connect 12 0 0 0;
#P connect 7 0 9 1;
#P connect 6 0 9 2;
#P connect 5 0 9 3;
#P connect 4 0 9 4;
#P connect 3 0 9 5;
#P connect 2 0 9 6;
#P connect 1 0 9 7;
#P connect 11 0 10 1;
#P pop;
#P newobj 76 246 138 196617 p BitMask;
#P number 76 272 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 202 222 15 0;
#P toggle 184 222 15 0;
#P toggle 166 222 15 0;
#P toggle 148 222 15 0;
#P toggle 130 222 15 0;
#P toggle 112 222 15 0;
#P toggle 94 222 15 0;
#N vpatcher 107 217 707 617;
#P window setfont "Sans Serif" 9.;
#P newex 50 108 67 196617 mxj list.sum;
#P newex 250 61 153 196617 loadmess 1 2 4 8 16 32 64 128;
#P newex 50 83 210 196617 vexpr $i1*$i2;
#P newex 50 50 138 196617 pak 0 0 0 0 0 0 0 0;
#P inlet 50 30 15 0;
#P inlet 68 30 15 0;
#P inlet 86 30 15 0;
#P inlet 104 30 15 0;
#P inlet 122 30 15 0;
#P inlet 140 30 15 0;
#P inlet 158 30 15 0;
#P inlet 176 30 15 0;
#P outlet 50 130 15 0;
#P connect 8 0 9 0;
#P connect 9 0 10 0;
#P connect 10 0 12 0;
#P connect 12 0 0 0;
#P connect 7 0 9 1;
#P connect 6 0 9 2;
#P connect 5 0 9 3;
#P connect 4 0 9 4;
#P connect 3 0 9 5;
#P connect 2 0 9 6;
#P connect 1 0 9 7;
#P connect 11 0 10 1;
#P pop;
#P newobj 517 88 138 196617 p BitMask;
#P number 517 114 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 643 64 15 0;
#P toggle 625 64 15 0;
#P toggle 607 64 15 0;
#P toggle 589 64 15 0;
#P toggle 571 64 15 0;
#P toggle 553 64 15 0;
#P toggle 535 64 15 0;
#P toggle 517 64 15 0;
#P comment 517 45 14 196617 1;
#P window setfont "Sans Serif" 18.;
#P window linecount 2;
#P comment 362 59 141 196626 Look for only exact matches:;
#P window setfont "Sans Serif" 9.;
#P window linecount 6;
#P user com 235 49 100 196617 52;
#K set 0 28025 8289 25203 29810 24931 29801 28526 8294 28530 8308
26725 8291 28526 29810 28524 27749 29223 29472 28005 29555 24935 25971
8308 26738 29984 23400 26973 11296 30568 26979 26656 27253 29556 8307
25966 25715 8308 26725 8240 29472 24942 25632 12659 8294 29295 27936
25953 25448 8290 30068 29807 28206;
#K end;
#P user panel 25 333 314 220;
#X brgb 171 220 142;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 90 0 82 0;
#P connect 82 0 91 0;
#P connect 24 0 69 0;
#P connect 69 0 22 0;
#P connect 22 0 21 0;
#P connect 21 0 32 0;
#P connect 25 0 14 0;
#P connect 14 0 22 1;
#P connect 26 0 15 0;
#P connect 15 0 22 2;
#P connect 27 0 16 0;
#P connect 16 0 22 3;
#P connect 28 0 17 0;
#P connect 17 0 22 4;
#P connect 29 0 18 0;
#P connect 18 0 22 5;
#P hidden connect 92 0 72 0;
#P connect 72 0 81 0;
#P connect 81 0 80 0;
#P connect 80 0 82 1;
#P connect 30 0 19 0;
#P connect 19 0 22 6;
#P connect 73 0 81 1;
#P connect 31 0 20 0;
#P connect 20 0 22 7;
#P connect 74 0 81 2;
#P connect 75 0 81 3;
#P connect 76 0 81 4;
#P connect 77 0 81 5;
#P connect 78 0 81 6;
#P connect 79 0 81 7;
#P connect 62 0 54 0;
#P connect 54 0 64 0;
#P connect 64 0 65 0;
#P connect 65 0 63 0;
#P connect 40 0 23 0;
#P connect 23 0 41 0;
#P hidden connect 66 0 44 0;
#P connect 44 0 53 0;
#P connect 53 0 52 0;
#P connect 52 0 54 1;
#P connect 52 0 65 1;
#P hidden connect 67 0 4 0;
#P connect 4 0 13 0;
#P connect 13 0 12 0;
#P connect 12 0 23 1;
#P connect 45 0 53 1;
#P connect 5 0 13 1;
#P connect 46 0 53 2;
#P connect 6 0 13 2;
#P hidden connect 66 0 47 0;
#P connect 47 0 53 3;
#P hidden connect 67 0 7 0;
#P connect 7 0 13 3;
#P connect 48 0 53 4;
#P connect 8 0 13 4;
#P connect 49 0 53 5;
#P connect 9 0 13 5;
#P connect 50 0 53 6;
#P hidden connect 67 0 10 0;
#P connect 10 0 13 6;
#P connect 51 0 53 7;
#P connect 11 0 13 7;
#P window clipboard copycount 93;


***
http://danwinckler.com
http://share.dj

http://gunshowimprov.com


May 10, 2006 | 6:43 am

Dan Winckler wrote:
> I’ve pasted below what I thought might test for A
> alone but it, of course, doesn’t. :)

the toggle will pass the 73, you don’t need the Bitmask if you know the
result. Each combination of buttons has a unique result when run through
the Bitmask. Just test for that result. Single buttons are… test it!

Stefan

#P toggle 61 514 30 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 61 452 90 196617 r Buttons.Encoded;
#P newex 61 482 127 196617 == 73;
#P toggle 76 222 15 0;
#P newex 76 294 90 196617 s Buttons.Encoded;
#P newex 202 197 35 196617 r 0_a;
#P newex 184 179 35 196617 r 0_b;
#P newex 166 161 53 196617 r 0_start;
#P newex 148 143 57 196617 r 0_select;
#P newex 130 125 40 196617 r 0_up;
#P newex 112 107 52 196617 r 0_right;
#P newex 94 89 53 196617 r 0_down;
#P newex 76 71 46 196617 r 0_left;
#N vpatcher 98 212 698 612;
#P window setfont "Sans Serif" 9.;
#P newex 50 108 67 196617 mxj list.sum;
#P newex 250 61 153 196617 loadmess 1 2 4 8 16 32 64 128;
#P newex 50 83 210 196617 vexpr $i1*$i2;
#P newex 50 50 138 196617 pak 0 0 0 0 0 0 0 0;
#P inlet 50 30 15 0;
#P inlet 68 30 15 0;
#P inlet 86 30 15 0;
#P inlet 104 30 15 0;
#P inlet 122 30 15 0;
#P inlet 140 30 15 0;
#P inlet 158 30 15 0;
#P inlet 176 30 15 0;
#P outlet 50 130 15 0;
#P connect 8 0 9 0;
#P connect 9 0 10 0;
#P connect 10 0 12 0;
#P connect 12 0 0 0;
#P connect 7 0 9 1;
#P connect 6 0 9 2;
#P connect 5 0 9 3;
#P connect 4 0 9 4;
#P connect 3 0 9 5;
#P connect 2 0 9 6;
#P connect 1 0 9 7;
#P connect 11 0 10 1;
#P pop;
#P newobj 76 246 138 196617 p BitMask;
#P number 76 272 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 202 222 15 0;
#P toggle 184 222 15 0;
#P toggle 166 222 15 0;
#P toggle 148 222 15 0;
#P toggle 130 222 15 0;
#P toggle 112 222 15 0;
#P toggle 94 222 15 0;
#P user panel 25 333 314 220;
#X brgb 171 220 142;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P newex 236 29 68 196617 NESRetroPad;
#P window linecount 6;
#P user com 235 49 100 196617 52;
#K set 0 28025 8289 25203 29810 24931 29801 28526 8294 28530 8308 26725
8291 28526 29810 28524 27749 29223 29472 28005 29555 24935 25971 8308
26738 29984 23400 26973 11296 30568 26979 26656 27253 29556 8307 25966
25715 8308 26725 8240 29472 24942 25632 12659 8294 29295 27936 25953
25448 8290 30068 29807 28206;
#K end;
#P connect 23 0 22 0;
#P connect 22 0 24 0;
#P connect 9 0 11 7;
#P connect 19 0 9 0;
#P connect 8 0 11 6;
#P connect 18 0 8 0;
#P connect 7 0 11 5;
#P connect 17 0 7 0;
#P connect 6 0 11 4;
#P connect 16 0 6 0;
#P connect 5 0 11 3;
#P connect 15 0 5 0;
#P connect 4 0 11 2;
#P connect 14 0 4 0;
#P connect 3 0 11 1;
#P connect 13 0 3 0;
#P connect 10 0 20 0;
#P connect 11 0 10 0;
#P connect 21 0 11 0;
#P connect 12 0 21 0;
#P window clipboard copycount 25;

[][] [][][] [][] [][][]
[][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

————————-x—-
–_____———–|———–
–(_|_ —-|—–|—–()—-
– _|_)—-|—–()———–
———-()————x—–

14, Av. Pr. Franklin Roosevelt,
94320 Thiais, France
Phone at CCMIX +33-1-57 42 91 09



dan
May 10, 2006 | 6:56 pm

Yes, this is all making perfect sense after a night’s sleep. :) And
after a half-hour of experimentation with various logic objects,
giving up and writing an email to ask, and typing the words "testing
for when the results go from 1 to 0…", I remember [togedge] and
figured out how to bang the toggle only after the button’s release. :D
i pasted it below.

thanks again,
dan

#P window setfont "Sans Serif" 18.;
#P window linecount 2;
#P comment 332 330 141 196626 Up press & release;
#P window linecount 1;
#P comment 332 178 141 196626 Up press;
#P window linecount 2;
#P comment 336 27 141 196626 Up + Left + B press;
#P toggle 339 266 30 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 339 204 90 196617 r Buttons.Encoded;
#P newex 339 234 31 196617 == 1;
#P user panel 327 177 155 133;
#X brgb 171 220 142;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P toggle 339 127 30 0;
#P newex 339 82 90 196617 r Buttons.Encoded;
#P newex 339 103 127 196617 == 73;
#P toggle 51 214 15 0;
#P newex 51 311 90 196617 s Buttons.Encoded;
#P newex 177 189 35 196617 r 0_a;
#P newex 159 171 35 196617 r 0_b;
#P newex 141 153 53 196617 r 0_start;
#P newex 123 135 57 196617 r 0_select;
#P newex 105 117 40 196617 r 0_up;
#P newex 87 99 52 196617 r 0_right;
#P newex 69 81 53 196617 r 0_down;
#P newex 51 63 46 196617 r 0_left;
#N vpatcher 406 206 1006 606;
#P window setfont "Sans Serif" 9.;
#P newex 50 108 67 196617 mxj list.sum;
#P newex 250 61 153 196617 loadmess 1 2 4 8 16 32 64 128;
#P newex 50 83 210 196617 vexpr $i1*$i2;
#P newex 50 50 138 196617 pak 0 0 0 0 0 0 0 0;
#P inlet 50 30 15 0;
#P inlet 68 30 15 0;
#P inlet 86 30 15 0;
#P inlet 104 30 15 0;
#P inlet 122 30 15 0;
#P inlet 140 30 15 0;
#P inlet 158 30 15 0;
#P inlet 176 30 15 0;
#P outlet 50 130 15 0;
#P connect 8 0 9 0;
#P connect 9 0 10 0;
#P connect 10 0 12 0;
#P connect 12 0 0 0;
#P connect 7 0 9 1;
#P connect 6 0 9 2;
#P connect 5 0 9 3;
#P connect 4 0 9 4;
#P connect 3 0 9 5;
#P connect 2 0 9 6;
#P connect 1 0 9 7;
#P connect 11 0 10 1;
#P pop 1;
#P newobj 51 262 138 196617 p BitMask;
#P number 51 289 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 177 214 15 0;
#P toggle 159 214 15 0;
#P toggle 141 214 15 0;
#P toggle 123 214 15 0;
#P toggle 105 214 15 0;
#P toggle 87 214 15 0;
#P toggle 69 214 15 0;
#P newex 211 21 68 196617 NESRetroPad;
#P window linecount 6;
#P user com 210 41 100 196617 52;
#K set 0 28025 8289 25203 29810 24931 29801 28526 8294 28530 8308
26725 8291 28526 29810 28524 27749 29223 29472 28005 29555 24935 25971
8308 26738 29984 23400 26973 11296 30568 26979 26656 27253 29556 8307
25966 25715 8308 26725 8240 29472 24942 25632 12659 8294 29295 27936
25953 25448 8290 30068 29807 28206;
#K end;
#P user panel 327 26 155 133;
#X brgb 171 220 142;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P toggle 368 464 30 0;
#P window linecount 1;
#P newex 334 439 44 196617 togedge;
#P newex 334 387 90 196617 r Buttons.Encoded;
#P newex 334 417 31 196617 == 1;
#P user panel 327 326 154 175;
#X brgb 171 220 142;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 17 0 26 0;
#P connect 26 0 16 0;
#P connect 16 0 15 0;
#P connect 15 0 25 0;
#P connect 18 0 8 0;
#P connect 8 0 16 1;
#P connect 19 0 9 0;
#P connect 9 0 16 2;
#P connect 20 0 10 0;
#P connect 10 0 16 3;
#P connect 21 0 11 0;
#P connect 11 0 16 4;
#P connect 22 0 12 0;
#P connect 12 0 16 5;
#P connect 23 0 13 0;
#P connect 13 0 16 6;
#P connect 24 0 14 0;
#P connect 14 0 16 7;
#P connect 2 0 1 0;
#P connect 1 0 3 0;
#P connect 28 0 27 0;
#P connect 27 0 29 0;
#P connect 32 0 31 0;
#P connect 31 0 33 0;
#P fasten 3 1 4 0 373 461 373 461;
#P window clipboard copycount 37;


***
http://danwinckler.com
http://share.dj

http://gunshowimprov.com


May 11, 2006 | 11:47 am

wow..thank you all guys for the suggestions :)



dan
May 13, 2006 | 11:11 pm

Another thing I’d like to learn is how to do temporal testing, that
is, testing for a certain combination of keys within a window of time,
e.g., up up down down left right left right b a b a select start
within 3 seconds. ;) Should I play with quickthresh for this? Advice
welcome.

thanks,
dan


***
http://danwinckler.com
http://share.dj

http://gunshowimprov.com


May 13, 2006 | 11:30 pm

timer could be of use here as well.

v a d e //

http://www.vade.info
abstrakt.vade.info


May 13, 2006 | 11:39 pm

Quote: dan wrote on Sun, 14 May 2006 01:11
—————————————————-
> Another thing I’d like to learn is how to do temporal testing, that
> is, testing for a certain combination of keys within a window of time,
> e.g., up up down down left right left right b a b a select start
> within 3 seconds. ;) Should I play with quickthresh for this? Advice
> welcome.

I find quickthresh extremely useful for this kind of thing, most definitely.


May 14, 2006 | 4:04 pm

maybe a gate and a match?


Viewing 17 posts - 1 through 17 (of 17 total)