Metronome with tap tempo
A free online metronome from 20 to 300 BPM with time signatures, subdivisions, accent patterns, tap tempo and a numbered beat display, timed on the audio clock.
A clear answer. Here’s how.
Plays a click at a steady tempo from 20 to 300 BPM and shows each beat as a number. BPM counts the note value at the bottom of the time signature: quarter notes in 2/4 to 5/4 and in a custom bar, eighth notes in 6/8, 7/8, 9/8 and 12/8, so 6/8 at 60 dotted quarters a minute is 180 here. Choose a time signature or a custom bar of 1 to 32 beats, divide each beat into eighths, triplets or sixteenths, and set every beat to normal, accented or muted. The first beat is accented by default, and 6/8, 9/8 and 12/8 also accent each group of three. Tap tempo averages the gaps between your last 8 taps (at least 2 are needed), starts again after 2 seconds without a tap and says how many taps it used. The tempo term (Largo, Andante, Allegro and so on) is read from the table in Wikipedia’s Tempo article in quarter notes per minute; such ranges are rough conventions that vary widely between composers and sources and overlap one another, so the page lists every term that fits. The clicks are short sine tones with a gain envelope made by the Web Audio API, with no audio files, and are scheduled with the lookahead pattern from Chris Wilson’s “A Tale of Two Clocks”: a timer wakes about every 25 ms and hands the audio clock every click due in the next 100 ms, so the rhythm does not depend on the busy main thread. Each click time is computed from the start time and the click number, t0 + n × 60 / (BPM × clicks per beat), never by adding intervals, so nothing drifts however long it runs. The beat display follows the same scheduled times. The audio clock is exact, but what you hear is later: speakers and wired headphones add a few milliseconds and wireless ones tens to hundreds that the page cannot measure (the display is delayed by the browser’s output-latency estimate where it gives one), and the display is drawn once per screen refresh. A hidden tab may run timers only once a second, so while the tab is hidden the lookahead grows to 1.5 seconds. Browsers start audio only after a click or key press, which is why sound begins when you press Start; if sound is blocked or missing, the metronome runs silently with the beat display. Nothing is stored or sent.
What this does not include
- Finding the tempo of a song, a file or a microphone: tap tempo only measures your taps.
- One tempo and one bar pattern at a time: no tempo ramps, setlists or polyrhythms.
- Exact timing with wireless speakers or headphones, whose delay the page cannot measure.
- Any claim about how fast a piece should be played: tempo terms are loose conventions.