Assigning an array of buffers into a Synth's argument

Hi,

Is it possible to assign an array into a Synth’s argument? I want to assign an array of buffers into a Synth’s argument—my objective is to randomly choose a buffer from that array of buffers within my SynthDef using a Demand UGen, specifically Drand that randomly choose a buffer from an array (of buffers).

Right now, my solution is to hard-wire an array of buffers into my SynthDef, but I want to flexibly assign any array of buffers.

Thank you,
Jay

yes you can!

c={ |freq=#[200,230,300]| SinOsc.ar( freq,0,0.1)}.play;
c.set(\freq,[300,340,444];

argument needs to be initialized to a literal array ie #[1.2.3] not [1,2,3]

This can also be done with NamedControl

See also threads mentioning array args, e.g.

This thread also contains an example with an array of buffers circumventing array args: