[sc-users] array as an arg
Dan Stowell
danstowell at gmail.com
Tue Aug 29 10:40:45 PDT 2006
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
More information about the sc-users
mailing list