// title: Nested ifs in a SynthDef // author: 38nonprivate // description: // A short, silly example of using if in a SynthDef. Using Select is generally a better thing to do. // code: ( { var noise, out; noise = LFNoise0.kr(8); out = if( noise > 0.0, if(noise > 0.5, if(noise > 0.9, WhiteNoise.ar(0.2), Pulse.ar(60, 0.5, 0.4)), SinOsc.ar(500, 0, 0.25) ), Saw.ar(160, 0.5) ); out ! 2 }.play; )