[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] BinaryOpUGen (instead of ==) confusion



Hi James,

yeah, that's the post I was referring to that I read .... unfortunately for my pea sized brain, it was just too much ... I thought I'd understood from that post that all I needed to do was use:

BinaryOpUGen('==', doppler, 1)

but that just creates an "ERROR: Non Boolean in test."

Etienne

On Tue, Jun 16, 2009 at 10:20 PM, James Harkins <jamshark70@xxxxxxxxx> wrote:
Perennial topic - I wrote a bedtime story about it once :)

https://listarc.bham.ac.uk/lists/sc-users/msg49373.html

(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