Hello,
I would like to know if it is possible to do "if then" testing like that in PD :
if A * B == 0 then
if C == 1 then
varA == A
varB == B
varC == C
else
varA == 1
varB == 1
varC == 1
endif
else
varA == 2
varB == 2
varC == 2
endif
\[Expr if...\] questions.
Hello,
I would like to know if it is possible to do "if then" testing like that in PD :
if A * B == 0 then
if C == 1 then
varA == A
varB == B
varC == C
else
varA == 1
varB == 1
varC == 1
endif
else
varA == 2
varB == 2
varC == 2
endif
thanks a lot ! I now have to study your patche to understand how it works.
here's another one
That's Xmas ! Thanx !
Another patch to study... But I discovered in it the object [value], very interesting.
Pd's [expr] object actually has an "if" operator. It has a different syntax than what you've written from Max, but it can be very useful.
Additionally, [expr] will accept variable names from the [v] object. When you combine these two you can get some very expressive code. (See attached.)
However, I only post this solution because your example gave named variables, plus one of your conditionals requires the original values. In general I'd steer clear of [v] because its interface will get in the way more often than not-- notice how I must bang the values out at the end to get the result.
And here's the example patch
Oops! Looks like something went wrong!