Playground · Metronome
A metronome with a practice log.
Set a tempo or tap it in, then choose the beats in a bar and how each beat divides; the first beat of the bar clicks higher. The clicks are timed on the browser's audio clock, not the page's timers, so they don't drift when the browser is busy. Every session of 30 seconds or more goes into a practice log kept in this browser only.
Tempo
stoppedBeats per bar
Subdivision
Practice log
Sessions of 30 seconds or more show up here. They're kept in this browser only.
How it keeps time
JavaScript timers are allowed to fire late, and they do, so a metronome built on them limps. This one asks the browser's audio clock to play each click at an exact time: every 25 milliseconds it schedules whatever falls in the next tenth of a second. The clicks land on time; only the lights follow the page's timer, so they can lag a little. Tap tempo averages the gaps between your taps from the last three seconds.
What this page sends
Nothing leaves your browser. The practice log (date, tempo and length of your last 20 sessions) is kept in this browser's localStorage, on this device. It's never sent anywhere, and Clear the log deletes it. The clicks are synthesised here, and the page makes no request to a server.