piapia123
en

Metronome

Media

Everything runs locally in your browser — nothing is uploaded

Metronome
120 BPM · 500 ms

⚠️ Beats are scheduled ahead on the audio clock rather than fired by a timer, so they stay steady even when the main thread is busy or the tab is in the background.

⚠️ What separates this metronome from most is something you cannot see: the beats are scheduled ahead on the audio clock rather than fired by a timer. The timer approach has three inevitable problems. Timers drift (a callback delayed by other work on the main thread arrives late, and the lateness accumulates, easily tens of milliseconds a minute, which a musician hears immediately). A sound has to begin at a precise moment in the future rather than right now. And a background tab has its timers throttled to once a second, which destroys the beat entirely. So here a timer running every 25 milliseconds only queues the next 100 milliseconds of beats into the audio clock, and the audio device decides when they actually sound — the timer being late does not matter. Three other things: tap tempo (tap along and the BPM is worked out for you), meter and accent (a downbeat on the first of four, a waltz feel on three), and tempo marks (grave 40, andante 76, allegro 120) so you do not have to remember numbers. Everything is synthesised locally in your browser.

Features

  • ⚠️ Beats are scheduled ahead on the audio clock, so a busy main thread or a background tab cannot make them drift
  • 30-300 BPM, with the slider and the number field in sync
  • Meters of 2/4, 3/4, 4/4 and 6/4, with the accent assignable to any beat (or off)
  • ⚠️ The accent is an octave up (1200 Hz against 800 Hz), so the downbeat is audible in any room
  • Tap tempo: tap along and get the BPM; a two-second pause starts a fresh round
  • Unsteady tapping is called out, because a wobbly reading says more about the tapping than the tempo
  • One-click tempo marks: grave, adagio, andante, moderato, allegro, presto, prestissimo
  • Keyboard: Space to start and stop
  • The sound is synthesised in the browser; no audio files and no network

How to use

  1. Pick a tempo mark, or drag the slider and type a BPM
  2. Set the meter and which beat carries the accent
  3. Press Start or hit Space; tap tempo finds the BPM you are aiming for
  4. Press Space again to stop

FAQ

Why not just fire a sound from setInterval?
Because that inevitably drifts. A timer only promises that at least that much time passes; a callback delayed by other work arrives late, and the lateness accumulates — tens of milliseconds a minute, which any musician hears at once. The fix is to let the timer do nothing but queue beats into the audio clock and let the audio device decide when they sound. The timer being tens of milliseconds late is harmless, because it is scheduling 100 milliseconds ahead.
Does it stay accurate in a background tab?
Yes, because the sounding has already been handed to the audio clock, and browsers mostly throttle timers and rendering in the background. ⚠️ Note that the sound does not stop when you switch tabs: playing audio keeps a tab active, which is browser behaviour rather than something this tool controls. Press Space to stop it.
Why do the accent and the other beats sound different?
The accent is 1200 Hz against 800 Hz for the rest, so the difference is pitch rather than volume. A volume difference is inaudible on a small speaker while a pitch difference is clear on anything. Put the accent on the first beat to hear the bar, or turn it off for an even pulse.
Why does the tap tempo reading wander?
Because it is measuring you. The reading uses the average interval between the first and last tap rather than the mean of adjacent gaps, which would fold every wobble into the result, so the steadier you tap the more accurate it is. With fewer than three taps no steadiness hint appears, since the sample is too small to mean anything. ⚠️ A two-second gap starts a new round; without that, two taps, a pause and two more would be read as one very slow tempo.

Related tools