Forums > MaxMSP

Changing number box without gettng a bang

June 28, 2007 | 6:21 pm

I would like to design something so that when a bang button is pressed, a number from a number box is sent. I don’t, however, want the number box to send out numbers when it changes. The patch I made almost works, but if the button is pressed more than two times in a row before the number is changed, the number box sends out a number when it is changed. There must be a better and easier way to do this. Patch is below:

max v2;
#N vpatcher 412 373 1012 773;
#P window setfont "Sans Serif" 9.;
#P number 167 82 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 111 60 15 0;
#P number 130 164 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 130 91 15 0;
#P newex 130 112 36 196617 buddy;
#P comment 60 60 100 196617 Bang here;
#P window linecount 4;
#P comment 212 82 100 196617 change the number here but don’t want the bottom number to change;
#P comment 170 165 100 196617 I want this to change only when the top bang button is pressed;
#P window linecount 1;
#P comment 111 45 14 196617 A;
#P comment 174 64 14 196617 B;
#P connect 8 0 6 0;
#P connect 6 0 5 0;
#P connect 8 0 7 0;
#P connect 5 1 7 0;
#P connect 9 0 5 1;
#P pop;


June 28, 2007 | 6:28 pm

>I would like to design something so that when a bang button is
>pressed, a number from a number box is sent. I don’t, however, want
>the number box to send out numbers when it changes. The patch I made
>almost works, but if the button is pressed more than two times in a
>row before the number is changed, the number box sends out a number
>when it is changed. There must be a better and easier way to do
>this. Patch is below:
>

why not use [i] ?? (or [f] if you use floats)

best

kasper

#P button 344 64 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 293 64 100 196617 Bang here;
#P comment 344 49 14 196617 A;
#P number 356 205 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 399 109 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 406 91 14 196617 B;
#P newex 355 155 27 196617 i;
#P number 167 82 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 111 60 15 0;
#P number 130 164 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 130 91 15 0;
#P newex 130 112 36 196617 buddy;
#P comment 60 60 100 196617 Bang here;
#P window linecount 4;
#P comment 212 82 100 196617 change the number here but don’t want
the bottom number to change;
#P comment 170 165 100 196617 I want this to change only when the top
bang button is pressed;
#P window linecount 1;
#P comment 111 45 14 196617 A;
#P comment 174 64 14 196617 B;
#P connect 16 0 10 0;
#P connect 10 0 13 0;
#P connect 12 0 10 1;
#P connect 9 0 5 1;
#P connect 5 1 7 0;
#P connect 8 0 6 0;
#P connect 8 0 7 0;
#P connect 6 0 5 0;
#P window clipboard copycount 17;


June 28, 2007 | 6:44 pm

Thanks for the reply. I am not sure what [i] is, and the patcher would not show up when I copied it into Textedit and saved it as a .pat file. Is there something missing in it?

Thanks!


June 28, 2007 | 6:44 pm


June 28, 2007 | 6:47 pm

Never mind. I figured it out. Thanks again!


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