I was wondering what would be the best way of making an if/else condition in pd? For example:
if $1 < 10 ....... do this
else - do this
Thanks alot.
-
Using if/else in pd
-
There are relational operators in Pd, objects [<] {<=] [==] [!=] [>=] [>] . Give them input and they output 0 for false and 1 for true. If you want to do calculations with an if in it, try the [expr] object, you can do [expr if(test-expression, true-expression, else-expression)] - but that outputs numbers, doesn't "do" an action.
You can connect the output of [<] (etc) to [select 0 1] - the first output will bang if true, the second if false, the third outputs anything that isn't already matched (in this case, nothing).