Forums > MaxMSP

"if" object trouble

September 16, 2007 | 2:49 pm

Hi,
maybe i miss something but when i use the if object the result only go to the next object (int) .. if i put a new object(like an other int) after the first int, nothing happen with the last int!
hum
trying will be more understanble than what i try to explain :)

max v2;
#N vpatcher 10 59 610 459;
#P window setfont "Sans Serif" 9.;
#P number 64 270 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user gswitch2 54 300 39 32 0 0;
#P toggle 54 239 15 0;
#P window linecount 1;
#P newex 54 209 147 196617 if $i1 < 3 then set 1 else set 0;
#B color 5;
#P window setfont "Sans Serif" 12.;
#P number 54 181 40 12 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P connect 0 0 1 0;
#P connect 1 0 2 0;
#P connect 2 0 3 0;
#P connect 2 0 4 0;
#P pop;

thanks


September 16, 2007 | 2:58 pm

On 16 sept. 07, at 16:49, freeka wrote:

> Hi,
> maybe i miss something but when i use the if object the result only
> go to the next object (int) .. if i put a new object(like an other
> int) after the first int, nothing happen with the last int!
> hum
> trying will be more understanble than what i try to explain :)

The problem is not the if obejct, but that you send out a message
which is "set [int]" instead of just the int value. Toggle understand
that set message as display the new value (check or not), but do not
send the value to the output. In that particular case, you could have
use [< 3] instead of if, to obtain the same result, with less typing.

HTH,
ej

max v2;
#N vpatcher 10 59 610 459;
#P window setfont "Sans Serif" 9.;
#P number 64 270 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user gswitch2 54 300 39 32 0 0;
#P toggle 54 239 15 0;
#P window linecount 1;
#P newex 54 209 147 196617 if $i1 < 3 then 1 else 0;
#B color 5;
#P window setfont "Sans Serif" 12.;
#P number 54 181 40 12 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P connect 0 0 1 0;
#P connect 1 0 2 0;
#P connect 2 0 3 0;
#P connect 2 0 4 0;
#P pop;


September 16, 2007 | 3:09 pm

Merci merci!


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