Same random value in multiple Pbinds

@semiquaver’s approach is possible in this way:

~noteStream = Pstutter(2, Pxrand([43, 46, 49], inf)).asStream;

Pdef(\o, Ptpar([
    0, Pbind(\chan, 0, \midinote, ~noteStream),
    0, Pbind(\chan, 1, \midinote, ~noteStream),
])).play(l).quant_(4);

In the given example Pseed would be possible too:

p = Pseed(1000, Pxrand([43, 46, 49], inf));

Pdef(\o, Ptpar([
    0, Pbind(\chan, 0, \midinote, p),
    0, Pbind(\chan, 1, \midinote, p),
])).trace.play(l).quant_(4);

The data sharing chapter in James’ pattern guide shows a general approach:

https://doc.sccode.org/Tutorials/A-Practical-Guide/PG_06g_Data_Sharing.html

Here a collection of further links:

1 Like