[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sc-users] BinaryOpUGen (instead of ==) confusion
- To: sc-users@xxxxxxxxxxxxxxxx
- Subject: [sc-users] BinaryOpUGen (instead of ==) confusion
- From: e deleflie <edeleflie@xxxxxxxxx>
- Date: Tue, 16 Jun 2009 20:45:43 +1000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=Gwb9Ww+gHeeOfUMLqyNTQE1M+oUEWFgwwfpsxbSR9tk=; b=rqkYxi2C1z7ox6UREkXJjFMHsOxm6O9DUVjVTMA+SDOoWoO+mNWpvq06pIrZA9Aihu MhlCpCV75muQiRri9yl8IlLRZro+1Lz6JhIpLybeI7AOYwKy9D5MLSJ2zF6kLpJY0QTW yQnniOaF6vmSVHtIvowraGDGikTI2/IEZGks4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=fbzwWmZTP7yFXOT9sBittIW/wSk6JG31cSj3S8wandVrUsviTj1pfNhtQ9Z/qRwxjV 4HQbZ7Cl9PYaLDOq2ajGdn2yhD/cmx/pwAic7+KGCO1anMQzL2LuT7OJqJc4MZKit0Ow EJy/SHg72m2Hldtdgz1uQVdMMleX9fegBfYe8=
- List-id: SuperCollider users mailing list <sc-users.create.ucsb.edu>
- Reply-to: sc-users@xxxxxxxxxxxxxxxx
- Sender: owner-sc-users@xxxxxxxxxxxxxxxx
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