Hello there,
I want to use Prown to create an array with 4 elements that will be used in a Pseq. I’d like the array to change after repeating twice.
I tried to use this method Pbind().collect({ |event| ~event = event; })
to capture values created by the Pbrown into an array, so that I can feed it into a Pseq in another Pbind:
(
~pc = Pbind(
\type, \rest,
\dur, 8,
\test, Pfunc({ Pbrown(0,4,2,inf).collect{ |i| i; }.asStream.nextN(4) }).trace
).collect({ |event| ~event = event; });
~mel = Pbind(
\dur, 1,
\scale, Scale.minor,
\degree, Pseq(~event[\test],inf).trace,
);
)
(
t = TempoClock(120/60);
~pcp = ~pc.play(t,quant:[8,0,0.1]);
~mp = ~mel.play(t,quant:8);
)
[~pcp,~mp].do(_.stop);
The environment variable ~event[\test]
does seem to be updated every 8 beat, however — and despite using a timing offset — Pseq doesn’t seem to read from it.
Do I need to do sth extra to “update” the Pseq? I tried to embed the Pseq into:
- Pfunc —
Pfunc({Pseq(~event[\test],2)})
— only returns “a Pseq” and no sound - Pn —
Pn(Pseq(~event[\test],2))
— same result as when Pseq isn’t embedded into anything
Also, if there is a better method than what I outlined here, please let me know!
Thanks,
cd