Hi Fish, I suspect for a better solution you might need to wait for the more experienced users to see your question (and demonstrate a more practical version). However, I wondered if you might - depending on what else you need doing - use Pdef and Psym. This is a very nice way of playing sequences, which can be changed mid stream. I’m not sure I got the order correct from your answer, but here’s what it could look like.
Load up your Pbinds here. I used your arrays so you can easily see which pattern applies to which.
(
a = [0.25, 1.25, 0.5, 0.5]; // original pseq
b = [0.5, 0.5, 0.5, 0.5]; // first repeat
c = [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5]; // second repeat
Pdef(\a, Pbind(\instrument, \default,\dur, Pseq(a, 1), \freq, 400));
Pdef(\b, Pbind(\instrument, \default,\dur, Pseq(b, 1), \freq, 400));
Pdef(\c, Pbind(\instrument, \default,\dur, Pseq(c, 1), \freq, 400));
);
Then play the whole thing here using a Pdef and Psym. Psym reads symbols, so in a way this works like a sequencer, just type in the symbol of your Pdef as needed. You can update this ‘live’, but it will start the sequence again.
Pdef(\play, Psym(Pseq("aabac", inf).trace)).play;
Lastly, you said you wanted to add a random/arbitrary value/array in. If so I guess you could follow the same principle as above and make a new Pdef(\f)
with Prand
, Pwhite
, or whatever?
Hope that helps.