Forums > MaxMSP

help with x>f && x<g

November 27, 2006 | 4:38 am

I cannot figure out how to do this in max. I want to know if a number is between two numbers, and if so to send a bang. I’ve tried stringing > objects, but then to carry the number through them I have to somehow bang it through from the bottom. It’s really confusing me, is there a simple way to do it using boolean operators like && or ||?


November 27, 2006 | 5:01 am

max v2;
#N vpatcher 20 74 620 474;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 191 102 66 196617 loadmess 10;
#P comment 120 70 20 196617 in;
#P number 140 69 56 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 140 217 15 0;
#P number 170 129 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 114 130 55 196617 maximum;
#P number 155 103 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 140 178 40 196617 split;
#P comment 99 104 55 196617 minimum;
#P comment 160 218 100 196617 bang if it is in range;
#P connect 7 0 2 0;
#P connect 2 0 6 0;
#P connect 3 0 2 1;
#P connect 9 0 5 0;
#P connect 5 0 2 2;
#P pop;


November 27, 2006 | 5:20 am

…..or try this :

#P toggle 330 187 15 0;
#P toggle 225 187 15 0;
#P button 255 218 15 0;
#P button 274 267 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 274 238 32 196617 sel 1;
#P newex 317 159 30 196617 < 10;
#P newex 274 216 27 196617 ==;
#P number 279 95 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 243 159 27 196617 > 0;
#P button 40 121 27 0;
#P number 40 54 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 40 87 145 196617 if $i1<10 && $i1>0 then bang;
#P fasten 6 0 9 0 260 214;
#P connect 6 0 5 1;
#P connect 6 0 11 0;
#P connect 4 0 3 0;
#P connect 4 0 6 0;
#P connect 3 0 10 0;
#P connect 3 0 5 0;
#P connect 9 0 5 0;
#P connect 1 0 0 0;
#P connect 0 0 2 0;
#P connect 7 0 8 0;
#P connect 5 0 7 0;
#P window clipboard copycount 12;


November 27, 2006 | 5:25 am

At 11:39 PM -0500 11/26/06, randy wrote:
>I cannot figure out how to do this in max. I want to know if a number is between two numbers, and if so to send a bang. I’ve tried stringing > objects, but then to carry the number through them I have to somehow bang it through from the bottom. It’s really confusing me, is there a simple way to do it using boolean operators like && or ||?

look at split or clip.

-C


Chris Muir | "There are many futures and only one status quo.
cbm@well.com | This is why conservatives mostly agree,
http://www.xfade.com | and radicals always argue." – Brian Eno


November 27, 2006 | 6:15 am

Thanks, those all work. Good to know.


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