Scale all event times around a pivot beat (mutates in place).
Each event's startBeat and endBeat are rescaled relative to pivot. A factor of 2 doubles the duration; 0.5 halves it.
startBeat
endBeat
pivot
Array of events to rescale.
The beat around which to scale.
Scale factor (> 1 stretches, < 1 compresses).
// Slow down a phrase to half speed, anchored at beat 0scaleEventTimes(layer.rotateEvents ?? [], 0, 2);// Double tempo from beat 8 onwards, pivoting at beat 8scaleEventTimes(layer.moveYEvents ?? [], 8, 0.5); Copy
// Slow down a phrase to half speed, anchored at beat 0scaleEventTimes(layer.rotateEvents ?? [], 0, 2);// Double tempo from beat 8 onwards, pivoting at beat 8scaleEventTimes(layer.moveYEvents ?? [], 8, 0.5);
Scale all event times around a pivot beat (mutates in place).
Each event's
startBeatandendBeatare rescaled relative topivot. A factor of 2 doubles the duration; 0.5 halves it.