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

Re: [sc-users] SynthDef with case



Also there is Select.ar.

Select.ar(filter, [z, LPF.ar(z, ...), ..., ...])

But ALL the filters will run simultaneously and you hear the output of only one, which means wasted CPU. For efficiency it would be better to split the filters into synthdefs separate from the source, as Vytautas said.

hjh

On Dec 22, 2007, at 6:07 AM, marinos wrote:

How can I define a SynthDef which chooses between possible alternatives routes? Something like a modular system.
I tried this idea:

SynthDef(\aaaa, {arg filter=0;
   var z=Pan2.ar(.....
         x= case
               {filter == 0} {z}
               {filter == 1} {LPF.ar(z,....}
               {filter == 2} ....
Out.ar(0,x)...


but this didn't worked. How
can I pass an argument to a synthdef which would change filter type??


: H. James Harkins

: jamshark70@xxxxxxxxxxxxxxxxx

: http://www.dewdrop-world.net

.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:


"Come said the Muse,

Sing me a song no poet has yet chanted,

Sing me the universal."  -- Whitman