Metronome
← All toolsA swinging brass pendulum keeps time the way a real metronome does, but the clicks underneath it are scheduled a fraction of a second ahead on the Web Audio clock rather than fired one at a time from a JavaScript timer — the standard lookahead-scheduler technique that keeps tempo sample-accurate even if the browser tab is busy or briefly throttled.
Metronome
Idle
120BPM
How to use the Metronome
- Set a tempo with the number field, the slider, or tap it live with Tap Tempo (tap at least twice at the beat you want).
- Choose a time signature — beats per bar and the beat unit — to set how the accent lights group.
- Tap Start. The first light in each bar (and the pendulum's turnaround) is accented louder unless you switch Accent off.
- Change tempo or time signature freely while it's running — the next beat picks up the new setting without a stutter.
FAQ
- Why not just use setInterval for the beat?
- setInterval fires late whenever the browser tab is busy, backgrounded, or the OS deprioritizes it — the errors accumulate and the tempo audibly drifts over a long run. Instead, every click's exact start time is scheduled on the Web Audio clock a fraction of a second ahead of when it plays, which is immune to that kind of jitter.
- What does the pendulum represent?
- It's a real-time view of the same schedule driving the clicks — its position each frame is computed directly from the current and next scheduled beat times, easing between them the way a physical pendulum decelerates at each turnaround, so what you see always matches what you hear.
- How does tap tempo work?
- Each tap is timestamped; once you've tapped at least twice, perfecttune averages the intervals between your last several taps and sets the BPM from that average — tap steadily for a few beats for the most accurate result.
- Can I use time signatures like 6/8 or 7/8?
- Yes — set beats-per-bar to the numerator and the beat unit to the denominator (2, 4, 8 or 16); the metronome computes each beat's real duration from both, so a 6/8 bar at a given tempo ticks at the correct eighth-note speed, not a quarter-note one.