DevTools Logo

Audio BPM Tap & Tempo Detector

Audio BPM Tap & Tempo Detector

Tap a beat or inspect sample energy rises locally

Tap tempo

0 taps recorded

About

Tap along to a beat and the detector estimates BPM from median inter-beat intervals while removing outliers with median absolute deviation. You can also paste sample values to detect energy-rise onsets and estimate a tempo in the 60–180 BPM range. No audio is uploaded.

Examples

120 BPM taps

Input
analyzeTaps([0, 0.5, 1.0, 1.5, 2.0]).bpm
Output
120

Half-second intervals convert via 60 / 0.5 to 120 BPM.

Onset histogram with octave folding

Input
bpmFromOnsets([0, 88200, 176400], 44100) + bpmFromOnsets([0, 22050, 44100], 44100)
Output
{ slow: 60, standard: 120 }

A 2 s gap reads 30 BPM but doubles into the 60–180 window as 60; half-second gaps vote 120.

About this tool

Audio BPM Tap Detector estimates tempo two ways: analyzeTaps(timestamps, { madThreshold, minBpm, maxBpm }) sorts finite taps, derives positive intervals, and returns bpm with intervals, filteredIntervals, medianInterval, and mad; bpmFromOnsets(frames, sampleRate) votes on onset-derived periods (aliases bpmFromTaps/calculateTapBpm, detectBpmFromOnsets/calculateBpmFromOnsets).

Tap filtering is median plus MAD: the median interval is the center, MAD is the median absolute deviation, tolerance is madThreshold (default 3) × MAD — or max(center × 0.08, 1e-9) when MAD is 0 — and intervals outside tolerance drop out before the stable median converts via 60 / interval. Default range is 30–300 BPM; empty or single taps yield bpm null.

Onset tempo folds octaves into 60–180 BPM by default (custom minBpm/maxBpm supported): each frame gap converts to 60 / seconds, doubles while below min, halves while above max, then votes in a rounded-integer histogram with ties broken toward 120. detectOnsets(samples, frameSize 1024, hopSize 512, threshold 0.01) (alias findOnsets) reports energy-rise frame starts for the histogram input.

How to use this tool

  1. Tap or load onsets

    Pass tap timestamps in seconds, or frame positions plus sampleRate for onset analysis.

  2. Read the estimate

    Check bpm plus filteredIntervals and mad — dropped intervals are the MAD outliers.

  3. Tune the window

    Set minBpm/maxBpm or madThreshold to tighten filtering for live tapping vs. file analysis.

Use cases

Tapping tempo live

Turn spacebar tap timestamps into a stable BPM readout with outlier rejection.

Analyzing drum loops

Feed energy-rise onsets into the histogram for file-based tempo detection.

Quantizing practice takes

Compare medianInterval drift across takes to spot rushing or dragging.

Common mistakes

Mistake:Expecting one stray tap to shift the tempo.

Fix:MAD filtering drops far-off intervals by design — check filteredIntervals to see what was excluded.

Mistake:Reading 30 or 240 BPM literally from onsets.

Fix:Onset candidates fold by octaves into 60–180 by default, so 30 becomes 60 and 240 becomes 120.

Frequently asked questions

What does this tool do?

It estimates tempo from tap timestamps with analyzeTaps (bpm, intervals, filteredIntervals, medianInterval, mad) and from onset frames with bpmFromOnsets, plus energy-rise onset detection via detectOnsets.

How do MAD filtering and the 60–180 window work?

Tap intervals filter by median ± madThreshold (default 3) × MAD with a center × 0.08 fallback when MAD is 0 (range 30–300 BPM); onset gaps fold by octaves into 60–180 BPM by default and vote in a rounded histogram with ties toward 120.

Is my audio uploaded or stored?

No. Tap math, histogram voting, and onset energy analysis run entirely in your browser.

Why is bpm null, or an outlier ignored?

Empty or single taps have no interval so bpm is null by design, and far-off intervals drop from filteredIntervals — a 30 BPM onset doubles to 60 and 240 halves to 120 in the default window.

References & standards