A while ago a posted a question about dynamically controlling Pbind
and got this great response from Alberto.
Now I am trying to update an array rather than a single controller.
I have tried modifiying my working dynamic Pbind example (below)
but its not really working. Am I going down the wrong path with this.
Ideally I would like a flexible set up where some parameters are controlled
by midi and others by updating arrays.. All while Pbind is running
along nicely.
Any thoughts.
Thanks
Simon
// your synthdef
SynthDef("sinew",
{arg midinote = 60, amp = 0.9, dur = 1, bus=0, attack = 0,length =
0.25, decay = 0,volu = 1;
var x;
x = SinOsc.ar(midinote.midicps, mul: amp)
*
EnvGen.kr(Env.linen(attack, length, decay,
volu), doneAction: 2);
Out.ar(bus,x);
}).store;
)
// a pdef with a silly name, use its environment
// to store a value for the name \decay
Pdef(\myPdef).set(\midinote, 60);
// put your pbind in that Pdef:
(
Pdef(\myPdef,
Pbind(
\midinote, Pfunc({|e| e.midinote}),
\dur, Pseq ([1,1],inf),
\volu, Pseq ([1,1],inf),
\bus, Prand ([0, 1],inf),
\decay, Pseq([0.5,0.5],inf),
\instrument, \sinew
)
);
)
Pdef(\myPdef).play;
// My attempt which just plays two notes rather than one after another
Pdef(\myPdef).set(\midinote, ([66,70]),inf);