Skip to content

Tempo and key detector

Choose an audio file to get an estimated tempo and key. The file is analysed in the browser and goes nowhere. The result is an estimate: the tempo may come out at half or double, and the key may be its relative major or minor.

File

Choose a music file (over 4 seconds) or try the demonstration.

The file stays in the browser; at most 60 seconds from the middle are analysed for tempo and 45 for key.

The ideas behind the controls

A tempo, not “the” tempo
The pulse is looked for in the autocorrelation of spectral changes, between 70 and 180 BPM. A tune in 6/8, or one felt at half speed, can come out at double or half; both readings are shown.
Key from the notes heard
The energy of each pitch class (equal temperament, A = 440 Hz) is added up and compared with the Krumhansl–Kessler profiles for major and minor in all 12 transpositions; the highest correlation wins.

Common mistakes

  • Taking the key as the key printed in the score: it is the most likely one from the notes heard, and the relative major or minor is often just as plausible.
  • Trusting the tempo on music with a changing tempo or no clear pulse: it then says “uncertain pulse” or “no clear pulse”.

What this tool cannot tell you

  • Tempo is searched only between 70 and 180 BPM; the preference for values near 120 BPM is the tool's choice, to settle between half and double.
  • The key assumes equal temperament with A = 440 Hz and does not find key changes within a piece.
  • Not the whole file: at most 60 seconds (tempo) and 45 seconds (key) from the middle.
  • It does not replace DJ software or a musician's analysis.

Where the formulas come from

  • Krumhansl–Kessler key profiles — The major and minor profiles (Krumhansl, Cognitive Foundations of Musical Pitch, 1990, p. 30, after Krumhansl and Kessler, 1982), read from public implementations (partitura and others), not from the book; the Krumhansl–Schmuckler algorithm compares the correlation with the 24 profiles.

Frequently asked questions

Is the file uploaded to a server?

No. The file is decoded and analysed in your browser and is sent nowhere.

Why does it give me double or half the tempo?

The real pulse can be felt at several levels (60 BPM can be counted as 120). The tool picks the level in the 70–180 BPM range and shows the alternatives.

Tempo and key detector · Strunin