[sc-users] array as an arg

wbrent at ucsd.edu wbrent at ucsd.edu
Tue Aug 29 04:29:22 PDT 2006


great, that was my next question :)   thanks to all...


> Just to add to Julian's response: you can't change the size of the
> array once you've stitched it into a SynthDef. People often ask this
> question, because of course it'd be nice if you could - but it just
> isn't practical, since a different number of channels at any point in
> the def is basically a different graph definition.
>
> Dan
>
>
> 2006/8/29, Julian Rohrhuber <rohrhuber at uni-hamburg.de>:
>> >hello list,
>> >
>> >is there a way to have an array for an arg in a SynthDef?  i tried the
>> arg
>> >...freq;  method that works for functions, but that doesn't seem to
>> work
>> >in SynthDefs.  is there another notation?
>>
>> SynthDef(\test, { arg out, freq=#[300, 400, 500];
>>         Out.ar(out, Saw.ar(freq).sum * 0.1)
>> });
>>
>> just make sure it is a literal array (#[..]).
>>
>> this works also for .play and for jitlib:
>>
>> n = { arg  freq=#[300, 400, 500]; Saw.ar(freq).sum * 0.1 }.play;
>> n.setn(\freq, [800, 900, 200]);
>>
>> or
>>
>> n = NodeProxy(s);
>> n.source = { arg  freq=#[300, 400, 500]; Saw.ar(freq).sum * 0.1 };
>> n.setn(\freq, [800, 900, 200]);
>> --
>>
>>
>>
>>
>>
>> .
>> _______________________________________________
>> sc-users mailing list
>> sc-users at create.ucsb.edu
>> http://www.create.ucsb.edu/mailman/listinfo/sc-users
>>
>
>
> --
> http://www.mcld.co.uk
> _______________________________________________
> sc-users mailing list
> sc-users at create.ucsb.edu
> http://www.create.ucsb.edu/mailman/listinfo/sc-users
>



More information about the sc-users mailing list