QUICK-REF - CsoundManual - Top of this section - Previous - Contents - Index - Next 

CONDITIONAL VALUES:

                    (a > b    ?  v1 : v2) 
                    (a < b    ?  v1 : v2) 
                    (a  > = b   ?  v1 : v2) 
                    (a  < = b   ?  v1 : v2) 
                    (a  = = b   ?  v1 : v2) 
                    (a  ! = b   ?  v1 : v2)

DESCRIPTION

where a, b, v1 and v2 may be expressions, but a, b not audio-rate.

In the above conditionals, a and b are first compared. If the indicated relation is true (a greater than b, a less than b, a greater than or equal to b, a less than or equal to b, a equal to b, a not equal to b), then the conditional expression has the value of v1; if the relation is false, the expression has the value of v2. (For convenience, a sole `=` will function as `= =`.)

NB.: If v1 or v2 are expressions, these will be evaluated before the conditional is determined.

In terms of binding strength, all conditional operators (i.e. the relational operators (>,<, etc.), and ?, and : ) are weaker than the arithmetic and logical operators (+, -, *, /, && and ||).

EXAMPLE:

               (k1 < p5/2 + p6 ? k1 : p7)
binds the terms p5/2 and p6. It will return the value k1 below this threshold, else the value p7.


QUICK-REF - CsoundManual - Top of this section - Previous - Contents - Index - Next 

HTML Csound Manual - © Jean Piché & Peter J. Nix, 1994-97