Randomness and Pbind

So here is a part of Pbind I wonder about.
Using the randomness tutorial we get the following, each Synth plays the same note.

// Now with a SynthDef. No randomness!
SynthDef("tutorial-NoRand", { |out| Out.ar(out, SinOsc.ar(440 + 200.rand, 0, 0.2)) }).add;
x = Synth("tutorial-NoRand");
y = Synth("tutorial-NoRand");
z = Synth("tutorial-NoRand");
x.free; y.free; z.free;

And the following creates a different note on each Synth

// With Rand, it works!
SynthDef("tutorial-Rand", { |out| Out.ar(out, SinOsc.ar(Rand(440, 660), 0, 0.2)) }).add;
x = Synth("tutorial-Rand");
y = Synth("tutorial-Rand");
z = Synth("tutorial-Rand");
x.free; y.free; z.free;

Doing Pbind with Rand creates always a different note

// always a different note, so Synth gets created multiple times
Pbind(\instrument, "tutorial-Rand").play;

This makes me wonder, is there some Pattern support, like in case of instrument and midinote, or maybe a library etc. for control bus mapping and creating a Synth only once?

I’m not totally clear what you’re after here, maybe you could describe in a little better detail?
Though, if you’re just looking for a way to control ONE synth with Event patterns, rather than creating new Synths for each event, then you want Pmono.

A Pbind like this ALWAYS creates a new Synth for each event - this doesn’t have anything to do with Rand etc.

1 Like