How can I set a Synthdef multichannel control arguments in a Pbind?

Hello

I’ve got a SynthDef with some multichannel control arguments.

SynthDef(\player1Noir, {
	var out = \out.kr(0);
	var startFreqs = \startFreqs.kr([50,400,600]);
	var endFreqs = \endFreqs.kr([100,500,800]);
	var durations = \durations.kr([100,100,100]);
	var kickInDelays = \kickInDelays.kr([0,0,0]);
	var gate = \gate.kr(1);
	var snd = 1.0;
	startFreqs.poll;
	3.do { |i|
		snd = snd * (1 - LFTri.ar(
			freq: EnvGen.ar(
				Env.new(
					levels: [0,0,startFreqs[i], endFreqs[i],0],
					times: [kickInDelays[i],0.01,durations[i],0.01]
				), gate: gate
			) * [
				LFNoise1.kr(0.1).range(1, 0.10.midiratio),
				LFNoise1.kr(0.1).range(1, 0.10.midiratio)
			]
		));
	};
	snd = (snd * 8.reciprocal).tanh;
	snd = LeakDC.ar(snd);
	snd = snd * EnvGen.kr(Env.asr, gate, doneAction: Done.freeSelf);
	Out.ar(out, snd);
}).add;

I can set the multichannel arguments when starting a Synth manually

x = Synth(\player1Noir, [\startFreqs, #[200,2000,4000]]);

also using a Pdef (needs double square brackets)

Pdef.new(\player1Noir, Pbind(*[
	instrument: \player1Noir,
	startFreqs: [[200,2000,4000]],
	dur: 1
])).play;

But I would like to have new values for the 3 start freqs every beat and I can’t make it work.

I’ve tried

Pdef.new(\player1Noir, Pbind(*[
	instrument: \player1Noir,
	startFreqs: [{ rrand(20, 2000).dup(3) }],
	dur: 1
])).play;

-> does not set startFreqs

Pdef.new(\player1Noir, Pbind(*[
	instrument: \player1Noir,
	startFreqs: [Pn(Plazy({ rrand(20, 2000).dup(3) }))],
	dur: 1
])).play;

-> same

[edited] OK ! I’ve finally found out a solution !

Pdef.new(\player1Noir, Pbind(*[
	instrument: \player1Noir,
	startFreqs: Pn(Plazy({ [ {rrand(20, 2000)}.dup(3) ] })),
	dur: 1
])).play;

Cheers

geoffroy

Or:

Pdef.new(\player1Noir, Pbind(*[
	instrument: \player1Noir,
	startFreqs: Pfunc { [{ rrand(20, 2000) } ! 3] },
	dur: 1
])).play;

Pdef.new(\player1Noir, Pbind(*[
	instrument: \player1Noir,
	startFreqs: Pfunc { rrand(20, 2000) }.clump(3).collect([_]),
	dur: 1
])).play;

Thanks Daniel !
I never know when I should use Pfunc or Plazy, here is a good situation.

And thanks for mentionning clump, which I did not know.