[sc-users] array as an arg

Julian Rohrhuber rohrhuber at uni-hamburg.de
Tue Aug 29 11:10:53 PDT 2006


>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]);
-- 





.


More information about the sc-users mailing list