[PD] [expr] for "if, then, else"?

Jonathan Wilkes jancsika at yahoo.com
Sat May 16 11:59:22 CEST 2009




--- On Fri, 5/15/09, padovani <josepadovani at yahoo.com.br> wrote:

> From: padovani <josepadovani at yahoo.com.br>
> Subject: Re: [PD] [expr] for "if, then, else"?
> To: 
> Cc: pd-list at iem.at
> Date: Friday, May 15, 2009, 2:15 PM
> You don't need to declare the
> variables...
> 
> it is just:
> 
> [expr if ($f3 > 0, $f1 + $f2, 0);
> if ($f3 < 0, $f1 - $f2, 0)]
> 
> but you will have 2 outlets (one for each "if"), and not an
> "else" for 
> the same outlet.... in fact, it would be nice to have an
> "else" on 
> Yadegari's externals...
> For more information see: http://www.crca.ucsd.edu/~yadegari/expr.html

Hi José
     I think the final 0 before the semicolon is the "else" part of the statement.  [expr if ($f3 > 0, $f1 + $f2, $f1 - $f2)] will give you only one outlet.  You can even nest if statements:
[expr if ($f3 > 0, $f1 + $f2, if ($f3 < 0, $f1 - $f2, 0))]

-Jonathan


      




More information about the Pd-list mailing list