bang bang mark 2

Apr 16, 2006 at 9:22pm

bang bang mark 2

how can get one bang to prevent another’s path when i dont know which will come first?

i ahve two bangs, and it doesnt matter which goes through, all that matters is only ONE goes through, how can i do this? i think a gate may be useful, but unsure

#25457
Apr 16, 2006 at 9:31pm

allow me to elaborate. I want to turn 4 buttons on a controller into eight. i think i can do this by using ‘combos, i.e two buttons being struck at once.

i need a system that will allow me to monitor if one button has been pressed and allow that bang through, but if two have been pressed together (or within a tight time frame) push a different bang though to a different part of the patch

can anyone help?

#74952
Apr 16, 2006 at 9:47pm

Is your controller a midi controller ?

What kind of information does the buttons send ? If it send a controller number with velocity 127 when pressed and velocity 0 when depressed it should be quite easy. You would use a select 127 and a select 0 and use an == operator to check wether 2 controllers are at the same value or something along those lines.

Quote: 88mph wrote on Sun, 16 April 2006 17:31
—————————————————-
> allow me to elaborate. I want to turn 4 buttons on a controller into eight. i think i can do this by using ‘combos, i.e two buttons

#74953
Apr 16, 2006 at 9:55pm

Quote: Nat wrote on Sun, 16 April 2006 15:47
—————————————————-
> Is your controller a midi controller ?
it is a gamespad, and the buttons are a simple 1 or 0.

i have deviced a method of evaluating wether or not one button is being pressed, and if so output its bang, but at the moment, if both buttons are pressed all it does is block the individual bang, not output one of its own.

here is the patcher

max v2;
#N vpatcher 0 44 1440 896;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 208 125 73 196617 select 97 115;
#P number 148 126 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 206 79 40 196617 key;
#P newex 253 377 55 196617 delay 100;
#P newex 122 378 55 196617 delay 100;
#P button 232 521 15 0;
#P button 119 521 15 0;
#P message 218 435 29 196617 stop;
#P message 115 430 29 196617 stop;
#P newex 231 464 55 196617 delay 100;
#P button 269 188 15 0;
#P button 206 188 15 0;
#P newex 119 459 55 196617 delay 300;
#P connect 2 0 4 0;
#P connect 8 0 4 0;
#P connect 1 0 0 0;
#P connect 4 0 0 0;
#P connect 0 0 6 0;
#P connect 2 0 8 0;
#P connect 10 0 11 0;
#P connect 12 0 1 0;
#P connect 10 0 12 0;
#P connect 1 0 5 0;
#P connect 9 0 5 0;
#P connect 2 0 3 0;
#P connect 5 0 3 0;
#P connect 3 0 7 0;
#P connect 1 0 9 0;
#P connect 12 1 2 0;
#P pop;

#74954
Apr 16, 2006 at 10:27pm

here is a new one. this will output a bang when both are pressed, but is buggy when you play with different combo’s

PS i have set it up to use the A and S keys for demonstration

max v2;
#N vpatcher 0 44 1440 896;
#P button 514 627 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 459 529 55 196617 delay 100;
#P button 549 475 15 0;
#P button 496 473 15 0;
#P message 528 365 14 196617 2;
#P message 508 364 14 196617 1;
#P newex 563 416 55 196617 match 2 1;
#P newex 497 416 55 196617 match 1 2;
#P newex 524 563 45 196617 onebang;
#P newex 208 125 73 196617 select 97 115;
#P number 148 126 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 206 79 40 196617 key;
#P newex 256 392 55 196617 delay 100;
#P newex 122 378 55 196617 delay 100;
#P button 232 521 15 0;
#P button 119 521 15 0;
#P message 218 435 29 196617 stop;
#P message 115 430 29 196617 stop;
#P newex 231 464 55 196617 delay 100;
#P button 269 188 15 0;
#P button 206 188 15 0;
#P newex 119 459 55 196617 delay 100;
#P connect 2 0 4 0;
#P connect 8 0 4 0;
#P connect 1 0 0 0;
#P connect 4 0 0 0;
#P connect 0 0 6 0;
#P connect 2 0 8 0;
#P connect 10 0 11 0;
#P connect 12 0 1 0;
#P connect 10 0 12 0;
#P connect 1 0 5 0;
#P connect 9 0 5 0;
#P connect 2 0 3 0;
#P connect 5 0 3 0;
#P connect 3 0 7 0;
#P connect 1 0 9 0;
#P connect 12 1 2 0;
#P connect 19 0 20 0;
#P connect 18 0 20 0;
#P connect 14 0 18 0;
#P connect 19 0 14 0;
#P connect 17 0 14 0;
#P connect 16 0 14 0;
#P connect 1 0 16 0;
#P connect 13 0 21 0;
#P connect 20 0 13 0;
#P connect 2 0 17 0;
#P connect 15 0 19 0;
#P connect 1 0 13 1;
#P connect 2 0 13 1;
#P connect 18 0 15 0;
#P connect 17 0 15 0;
#P connect 16 0 15 0;
#P pop;

#74955
Apr 16, 2006 at 10:58pm

to anyone who cares, i have solved it, and i think its a quite useful patch, so here it is

max v2;
#N vpatcher 0 44 1440 896;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 461 180 55 196617 delay 150;
#N comlet Change Delay time (default 100);
#P inlet 373 422 15 0;
#P outlet 471 635 15 0;
#P outlet 213 626 15 0;
#P outlet 119 632 14 0;
#P inlet 164 89 15 0;
#P inlet 90 88 15 0;
#P window linecount 19;
#P comment 656 98 84 196617 Patcher allows the use of “combos” Both inputs recieve bangs. If they are banged seperatley (or more than 100 milliseconds apart) then the appropriate output is banged. If both a struck together , then a bang is routed to the third outlet third inlet allows change to delay time;
#P window linecount 1;
#P comment 440 667 100 196617 combo hit;
#P comment 206 664 100 196617 right input single;
#P message 534 218 34 196617 reset;
#P button 481 564 15 0;
#P newex 426 468 55 196617 delay 100;
#P newex 491 500 45 196617 onebang;
#P newex 256 392 55 196617 delay 100;
#P newex 122 378 55 196617 delay 100;
#P button 232 521 15 0;
#P button 119 521 15 0;
#P message 218 435 29 196617 stop;
#P message 115 430 29 196617 stop;
#P newex 231 464 55 196617 delay 100;
#P button 269 188 15 0;
#P button 206 188 15 0;
#P newex 119 459 55 196617 delay 100;
#P comment 96 665 100 196617 left input single;
#P button 516 412 15 0;
#P button 463 410 15 0;
#P message 495 302 14 196617 2;
#P message 475 301 14 196617 1;
#P newex 530 353 55 196617 match 2 1;
#P newex 464 353 55 196617 match 1 2;
#P connect 9 0 11 0;
#P connect 15 0 11 0;
#P connect 8 0 7 0;
#P connect 11 0 7 0;
#P connect 7 0 13 0;
#P connect 13 0 26 0;
#P connect 9 0 15 0;
#P connect 29 0 7 1;
#P connect 29 0 15 1;
#P connect 24 0 8 0;
#P connect 14 0 27 0;
#P connect 8 0 12 0;
#P connect 16 0 12 0;
#P connect 9 0 10 0;
#P connect 12 0 10 0;
#P connect 10 0 14 0;
#P connect 8 0 16 0;
#P connect 25 0 9 0;
#P connect 29 0 10 1;
#P connect 29 0 16 1;
#P connect 4 0 18 0;
#P connect 5 0 18 0;
#P connect 8 0 30 0;
#P connect 9 0 30 0;
#P connect 0 0 4 0;
#P connect 3 0 0 0;
#P connect 20 0 0 0;
#P connect 2 0 0 0;
#P connect 5 0 0 0;
#P connect 29 0 18 1;
#P connect 19 0 28 0;
#P connect 8 0 2 0;
#P connect 17 0 19 0;
#P connect 18 0 17 0;
#P connect 9 0 3 0;
#P connect 1 0 5 0;
#P connect 8 0 17 1;
#P connect 9 0 17 1;
#P connect 3 0 1 0;
#P connect 2 0 1 0;
#P connect 20 0 1 0;
#P connect 4 0 1 0;
#P connect 30 0 20 0;
#P pop;

#74956
Apr 17, 2006 at 5:20am

>how can get one bang to prevent another’s path when i dont know >which will come first?

try [onebang] :

#P button 138 120 15 0;
#P button 82 194 15 0;
#P toggle 82 48 15 0;
#P button 82 120 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 82 80 32 196617 sel 1;
#P toggle 42 48 15 0;
#P button 42 119 15 0;
#P newex 42 80 32 196617 sel 1;
#P newex 82 157 45 196617 onebang;
#P window linecount 3;
#P comment 151 53 100 196617 play with the toggles and notice how the bangs are filtered;
#P connect 2 0 3 0;
#P connect 3 0 1 0;
#P connect 4 0 2 0;
#P connect 7 0 5 0;
#P connect 5 0 6 0;
#P connect 6 0 1 0;
#P connect 1 0 8 0;
#P connect 9 0 1 1;
#P connect 5 1 9 0;
#P connect 2 1 9 0;
#P window clipboard copycount 10;

#74957

You must be logged in to reply to this topic.