im trying to pass an array of buffers as an array argument through Pproto for usage within a SynthDef.
As im using Pfunc the double quotes wont do as usually for array args.
Is there eventually another way to pass it then?
p= (Pspawner({|sp|
sp.par(Pproto(
{ ~sbuf=(20.collect{ |index| ( ( type: \allocRead, path: Platform.resourceDir +/+ "sounds/%.wav".format(index)).yield)}); //collecting sound buffers
},Pbind(
\instrument, \test,
\dur,dur,
\bufA, Pfunc { |ev| ev[\sbuf].at((0..19))}, //but how to pass them as array arg for synthdef instead of creating 20 events?
....
Here is an example with 4 buffers, with tracing and polling, so that you can see in the Post window all the Events from the Pbind and the controls received by the synths:
Thank you @elgiano! Im perplexed as i was sure had tried to wrap the bufnums with the necessary extra brackets to achieve just that, but i must’ve gotten something wrong then…Working perfectly now, cheers!