Adjustable tempo with an accented downbeat and tap tempo

Schedule accented browser-audio clicks from 30 to 300 beats per minute with tap-tempo averaging.

freeworks offlinenothing uploaded
ToolMetronome
120
bpm

Space to start or stop · T to tap tempo · Up/Down to adjust bpm

How it works

Beat spacing is 60,000 ÷ BPM, and a look-ahead loop schedules oscillators on AudioContext.currentTime instead of emitting sound directly from animation callbacks. Beat zero receives the accent; tap tempo averages gaps among up to eight recent timestamps.

Formula
beat interval milliseconds = 60,000 ÷ beats per minute
  • 120 BPM and four beats per bar provide a familiar starting pulse.
  • Audio begins only after a user action because browsers restrict unsolicited playback.

Worked example

A 120 BPM bar in 4/4
Input
											BPM: 120
Beats per bar: 4
										
Output
												Beat interval: 500 ms
Pattern: ACCENT · click · click · click
											

When to use this

Musicians practise scales, drummers recover a remembered tempo, and dancers rehearse accented beat groups.

Edge cases

  • One tap has no interval and therefore cannot produce BPM.
  • An uneven tap affects the recent-gap mean rather than replacing tempo from one interval.
  • Bluetooth and speaker latency shift when clicks are heard even when Web Audio schedules them consistently.

References