if-then problem

Jun 10, 2012 at 5:21pm

if-then problem

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. –
#46674
Jun 10, 2012 at 5:23pm

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

#167923
Jun 10, 2012 at 5:47pm

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. –
#167924
Jun 10, 2012 at 5:56pm

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...

#167925
Jun 10, 2012 at 6:58pm
#167926
Jun 10, 2012 at 11:13pm

da capo

#167927

You must be logged in to reply to this topic.