I’m trying to understand why the timing of the patterns below gets sort of wonky if i execute the second block on the fly, as the first one is still playing. It’s not hard for me to command period and run the second one in order to get the right timing, but i’d like to understand what it is that i’m missing. I tried different quant values for the Pdefs, but i still get the same results. I suspect it has something to do with some of the \dur values being Pseqs –– it’s as if the second block’s durations were not snapping/aligning right sometimes (that’s the best way i can describe it). Cheers!
Pdef(\x).quant = 0;
Pdef(\y).quant = 0;
// first block:
Pdefn(\melamp, Pbjorklund(9, 12, inf, 0)); Pdefn(\kickamp, Pbjorklund(1, 10, inf, 0)); Pdefn(\hhamp, Pbjorklund(2, 10, inf, 0)); Pdef(\x, Pbind(\type, \midi, \chan, 0, \midicmd, \noteOn, \midiout, m, \dur, 0.2, \midinote, Pseq([60, 66, 64, 63], inf), \legato, 0.3, \amp, Pdefn(\melamp))).play; Pdef(\y, Pbind(\type, \midi, \chan, 1, \midicmd, \noteOn, \midiout, m, \dur, 0.1, \midinote, 44, \legato, 1, \amp, Pdefn(\kickamp))).play;
// second block:
Pdefn(\melamp, Pbjorklund(3, 6, inf, 2)); Pdefn(\kickamp, Pbjorklund(3, 12, inf, 0)); Pdefn(\hhamp, Pbjorklund(3, 12, inf, 0)); Pdef(\x, Pbind(\type, \midi, \chan, 0, \midicmd, \noteOn, \midiout, m, \dur, Pseq([0.2,0.1,0.1], inf), \midinote, Pseq([60, 66, 64, 63], inf), \legato, 0.4, \amp, Pdefn(\melamp))).play; Pdef(\y, Pbind(\type, \midi, \chan, 1, \midicmd, \noteOn, \midiout, m, \dur, 0.1, \midinote, 44, \legato, 1, \amp, Pdefn(\kickamp))).play;