Thank you both @jamshark70 and @Thor_Madsen for your help, I really appreciate it!
What I indeed tried to achieve is to “rerun” a finite pattern stored in a Pdef without having to run Pdef().stop then Pdef().play.
And it is also true that I assumed that Pdef() binds/“remembers” the clock I assigned/connected to it initially.
So this doesn’t get me the right result, because I guess in this case the clock is bound to the Pdef only once:
(
t = TempoClock(100/60);
a = Pbind(
\dur, 1,
\note, Pbrown(0,7,2,8)
);
m = Pbind(
\dur, 1,
\note, Pseq([24]++(12!3),inf));
Pdef(\pd, a).play(t,quant:[4,0]);
Pdef(\pdm, m).play(t,quant:[4,0]);
)
Pdef(\pd,a); // when rerun, the tempo is default (60BPM) and snapped to the 4th beat at this default tempo
Pdef.removeAll;
but when I explicitly set the clock to the desired value before playing the Pdef, so:
(
t = TempoClock(100/60);
a = Pbind(
\dur, 1,
\note, Pbrown(0,7,2,8)
);
m = Pbind(
\dur, 1,
\note, Pseq([24]++(12!3),inf));
Pdef(\pd, a).clock_(t).play(quant:[4,0]);
Pdef(\pdm, m).clock_(t).play(quant:[4,0]);
)
Pdef(\pd,a);
Pdef.removeAll;
Then the Pdef rerun is played back at 100BPM and is snapped at the 4th beat ![]()
It’s great to have a better understanding of how to use Pdef for creating phrases/motifs and quantizing them! ![]()
Best,
cd