Swing is arithmetic
Swing lives inside pairs of sixteenths: the even step sits on the grid and the odd step slides late within its pair. Fifty percent is straight time, sixty six leans on the triplet. One function times the audio, the playhead, the ampersand, and the scroll reveals, so the whole page shares a single sense of where the beat is.
// Swing lives inside pairs of sixteenths: the even step sits on the grid,
// the odd step slides late within its pair. 54% is a polite lean.
_delta(fromStep) {
const pair = this.stepDur() * 2;
const frac = this.swingPct / 100;
return fromStep % 2 === 0 ? pair * frac : pair * (1 - frac);
}