Skip to main content

Beats & Bars Example

Timescale displays bar and beat markers based on BPM and time signature. Clips snap to the selected grid resolution when dragged. Switch between bar-level and beat-level snap, or disable snapping entirely.

Loading...

What is PPQN?

PPQN (Pulses Per Quarter Note) is the timing resolution used by MIDI sequencers and DAWs to subdivide each beat. A higher PPQN means finer rhythmic precision. This library uses 192 PPQN to match Tone.js's internal transport resolution, enabling accurate placement of notes and clips on a musical grid.

For example, at 192 PPQN in 4/4 time, each bar contains 192 × 4 = 768 ticks. Snap-to-grid quantizes clip positions to the nearest tick boundary at the selected resolution (bar or beat), ensuring clips align perfectly with the musical grid regardless of tempo or time signature.

How PPQN relates to BPM

PPQN defines spatial resolution (how many ticks per beat), while BPM defines temporal resolution (how fast beats play). Together they determine the real-time duration of a single tick:

tick duration = 60 / (BPM × PPQN)

At 120 BPM with 192 PPQN, each tick is 60 / (120 × 192) ≈ 0.0026s (about 2.6 ms). Double the tempo to 240 BPM and each tick halves to ~1.3 ms — but there are still exactly 192 ticks per beat. This is why PPQN is tempo-independent: it measures musical position, not clock time.

Try it: change the BPM above and watch the timescale markers shift as each bar occupies a different number of audio samples. Drag a clip with snap enabled — it locks to the nearest beat or bar line.

Audio Credits: "Ubiquitous" by Albert Kader — Minimal Techno stems from the Cambridge Music Technology multitrack library. Licensed under CC BY 4.0.