Hello everyone,
This thread is related to this one on rerunning Pdefs at different tempi which was resolved, but bumped into the following problem since then:
I have a Pdef playing back a finite Pbind, at 120bpm. I’d like to rerun this Pdef while simultaneously changing Pbind to another finite one as well as changing the quantization.
I created several versions, none of them playback with half a beat of offset. Some play the pattern back with 120bpm at first run, some don’t. Some - but not all - only play back the pattern at 120bpm with an offset if I rerun the same line. I got lost at what is going on here, I’ve been trying to make this work for a while now, tried to follow the instructions in several tutorials, forum threads, I suspect it shouldn’t be this difficult but I seem to not find material that helps me with this. In any case, this is my take on it:
(
SynthDef("gpdef",
{ arg out=0, freq=440, sustain=0.05, amp=0.1, pan;
var env;
env = EnvGen.kr(Env.perc(0.01, sustain), doneAction: Done.freeSelf) * amp;
Out.ar(out, Pan2.ar(SinOsc.ar(freq, 0, env), pan))
}).add;
Pdef(\metronom).quant_([8,0]); // start at the 8th beat
Pdef(\x); // start at the 8th beat
// Pbinds
a = Pbind(\dur, 1, \degree, Pseq([3, 4, 5b, 6]+1, 2));
b = Pbindf(a, \instrument, \gpdef);
m = Pbind(\instrument, \gpdef, \dur, 1, \degree, Pseq([28,14,14,14,21,14,14,14],inf), \legato, 0.1);
t = TempoClock(2);
Pdef(\metronom, m).play(t);
"SynthDef + Pbinds + start metronome";
)
// play on the 8th beat, no quant offset
Pdef(\x, b).quant_([8,0]).play(t);
// change Pbind + quant offset in the same time
// v1
Pdef(\x, a).quant_([8,0.5]).play(t); // doesn't play it back at 120BPM + no offset, even when rerun
// v2
Pdef(\x).remove; "Pdef(\x) removed";
Pdef(\x); "silent Pdef(\x) started";
Pdef(\x, b).quant_([8,0]).play(t); "start default Pbind + quant values";
Pdef(\x, a).clock_(t).quant_([8,0.5]).play; // doesn't play it back at 120BPM + no offset; only if I rerun this will it be played back at 120BPM with an offset of half a beat.
// v3
Pdef(\x).remove; "Pdef(\x) removed";
Pdef(\x); "silent Pdef(\x) started";
Pdef(\x, b).quant_([8,0]).play(t); "start default Pbind + quant values";
Pdef(\x).quant_([8,0.5]).clock_(t); "assign the quant values and the clock to the Pdef only, without playing it back"
Pdef(\x,a).play; // playback at 120BPM, but no offset, only if I rerun this line.
// v4
Pdef(\x).remove; "Pdef(\x) removed";
Pdef(\x); "silent Pdef(\x) started";
Pdef(\x, b).quant_([8,0]).play(t); "start default Pbind + quant values";
Pdef(\x).clock_(t); "assign the quant values to the Pdef only, without playing it back"
Pdef(\x,a).play(quant:[8,0.5]); // playback at 120BPM, but no offset, only if I rerun this line.
// v5
Pdef(\x).remove; "Pdef(\x) removed";
Pdef(\x); "silent Pdef(\x) started";
Pdef(\x, b).quant_([8,0]).play(t); "start default Pbind + quant values";
Pdef(\x).clock_(t); "assign the quant values to the Pdef only, without playing it back"
Pdef(\x,a).quant_([8,0.5]).play; // playback at 120BPM, but no offset, only if I rerun this line.
Pdef.removeAll; "Pdefs removed";
I’d really appreciate if someone could explain why I can not rerun a Pdef with a new finite Pbind at 120bpm with an offset simultaneously.
Thank you,
cd