Forums > MaxMSP

if-then problem

June 10, 2012 | 5:21 pm

I want to test a number and if it is bigger than the other it goes out via outlet1, else via outlet2. I manage to let the number go to outlet1 when the tested is higher than $i2 but it never goes to outlet2 if it smaller. What am I doing wrong?

– Pasted Max Patch, click to expand. –

June 10, 2012 | 5:23 pm

if $i1 > $i2 then $i1 out1 else out2 $i1


June 10, 2012 | 5:47 pm

Thanks, the if-then statement always gioves me trouble. Anyway, what I want to do is to test a number and subtract $i2 from that tested number until it is smaller than $i2. the idea is to create the earthworm sequence: http://www.gustavodiazjerez.com/?p=254
Now, with the third instance of the if-then statement, when the rsult pours out, I get "99 out1" which is odd because that does not happen in the other two statements.

– Pasted Max Patch, click to expand. –

June 10, 2012 | 5:56 pm

try:

if $i1 < $i2 then $i1 else out2 $i1

out1 doesn’t have to be specified and therefore is seen as a string that you want to output the first outlet, if $i1< $i2...



June 10, 2012 | 11:13 pm

da capo


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