Page 1 of 1

IF statement with more than one parameter

Posted: 23 Jun 2016 15:55
by Kabuki
Hello Lemur Forum!

I've been working on a softsynth controller and would like to select the LFO speed using two drop-down menus:

Denominator (1/2, 1/4)
Type (Straight, Dotted)

Based on these combinations I'd then send the respective value to the LFO speed knob on the softsynth.

However, I can't seem to find a way to combine two conditions in one IF statement, such as:

if denominator = 1 and type = 0 then set lfospeed = 0.138

Does anybody know the correct syntax for this?
Thanks for your help!

K.

Re: IF statement with more than one parameter

Posted: 24 Jun 2016 22:53
by CSharpDude
I think you want to use logical operators (page 145 in the manual):

if(denominator ==1 && type ==0){
// Do something really cool!
}

&& is AND
|| is OR
! is NOT

Hope it helps!

Dave

Re: IF statement with more than one parameter

Posted: 25 Jun 2016 19:33
by Kabuki
Hello Dave!

Thanks so much for your explanation.
I used the pointed brackets incorrectly, which is why my script didn't work.
You're a boss!

K.