Perennial topic - I wrote a bedtime story about it once :)
(You're still writing if(condition, { true }, { false }) which is not valid inside a SynthDef.)
hjh
On Jun 16, 2009, at 6:45 AM, e deleflie wrote:
I've googled the list archives ... and found discussions on how the comparison statement in an if condition is shorthand for binary op Ugens. I've tried substituting my comparions statements with BinaryOpUGen longhand ... but I still cant get that to work.
In this code snippet, the if condition always evaluates to false ... even if doppler is set to 1.
SynthDef("encode_N3D",
{ arg outBus = 0, azi = 0, ele = 0, distance = 1, inBus = 0, moveIn = 1.0, doppler = 1;
... snip ....
var audioOutput = if (doppler == 1, { DelayL.ar( air_attenuated_input, maxDelayTime , delayTime )} , {air_attenuated_input} );
In this below code, I've used BinaryOpUGen('==', doppler, 1) ... but this time I get a "ERROR: Non Boolean in test."
SynthDef("encode_N3D",
{ arg outBus = 0, azi = 0, ele = 0, distance = 1, inBus = 0, moveIn = 1.0, doppler = 1;
... snip ....
var audioOutput = if ( BinaryOpUGen('==', doppler, 1), { DelayL.ar( air_attenuated_input, maxDelayTime , delayTime )} , {air_attenuated_input} );
Can anyone see what I have done wrong?
Etienne
: H. James Harkins
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:
"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal." -- Whitman