home/ atoms/ sc-patterns-tempo-stretch-quant

Pbind's stretch key converts rhythmic fractions to absolute seconds; quant locks changes to a grid

Pbind’s \dur key specifies delta time in raw seconds by default, which is inconvenient for musical tempo thinking. The \stretch key multiplies all dur values by a constant: setting dur=1/16 and stretch=60/128*4 produces 16th notes at 128 BPM in 4/4. The quant argument to .play(quant:seconds) or .quant_(seconds) defers pattern changes to the next grid boundary. If two patterns share the same quant value, changes to either are synchronized to the same downbeat. This enables beat-locked performance without a separate global clock.

Examples

Pdef(\x, Pbind(\dur, Pseq([1/16], inf), \stretch, 60/128*4, ...)).play(quant: 60/128*4); // Changes re-evaluated mid-phrase will snap to the next bar.

Assessment

At 120 BPM in 4/4, what stretch value gives 16th notes? If you call .quant_(1.0) on two different Pdefs, what guarantee do you get about when changes take effect?

“we set the event stream player's quant argument, in parentheses, immediately following the play message”
corpus · supercollider-tutorials-full-transcripts-and-code-eli-fields · chunk 28