|
"if(condition, { true }, { false })" evaluates either the true or false branch once, at the time the SynthDef is compiled. Then the result is hardcoded into the SynthDef. For that to happen, the Boolean value of the condition has to be known when the SynthDef is compiled. But the condition depends on values that don't exist until the Synth is played. By wrapping true and false in functions, you're inadvertently asking the language to evaluate a condition now for values to be calculated later, which is impossible. BinaryOpUGen('==', doppler, 1) is not a Boolean -- it's a signal that will be 0 for false and 1 for true. You can use this with if, but as noted in the earlier post, if you do that, the true and false branches must both be signals, not functions or any other kind of object. So, take out the curly braces :) hjh On Jun 16, 2009, at 8:28 AM, e deleflie wrote: Hi James, : H. James Harkins .::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..: "Come said the Muse, Sing me a song no poet has yet chanted, Sing me the universal." -- Whitman |