Understanding BPM and Musical Key Detection
What BPM and key mean, why they matter for mixing, and how AI detects them automatically from audio.
After separating your track, Song Splitter automatically analyses the audio and displays its BPM and musical key. Here's what those values mean and why they're useful.
What is BPM?
BPM stands for Beats Per Minute — a measure of a track's tempo. A song at 120 BPM has 120 quarter-note beats in every minute. Most electronic dance music sits between 120–140 BPM; hip-hop typically ranges from 70–100 BPM; Afrobeats and Amapiano often fall in the 100–115 BPM range.
Knowing a track's BPM is essential for:
- DJ mixing: Beatmatching two tracks requires knowing their tempos to sync them precisely.
- Sampling: When you chop a loop into your DAW, you need the BPM to align the loop to your project grid.
- Time-stretching: Adjusting a sample to a different tempo without changing its pitch requires the original BPM as a reference.
How does Song Splitter detect BPM?
Song Splitter uses librosa's beat tracking algorithm, which works in two steps:
- It computes an onset strength envelope — a signal that peaks whenever a rhythmic event (like a drum hit) occurs.
- It finds the periodic pattern in those onsets that best fits a regular tempo, using dynamic programming to track the beat even when it shifts slightly.
This works well on most music but can struggle with tracks that have no clear rhythmic pulse (ambient, certain jazz pieces) or with very irregular rhythms.
What is Musical Key?
A musical key defines the set of notes that a piece of music is built around. A song in C Major primarily uses the notes C, D, E, F, G, A, B. A song in A Minor uses A, B, C, D, E, F, G. Each key has a characteristic emotional colour — major keys tend to feel bright and happy; minor keys often feel darker or more melancholic.
Knowing a track's key is important for:
- Harmonic mixing: DJs use key detection to ensure two tracks playing together are harmonically compatible.
- Melodic sampling: If you're layering a sample over a new instrumental, both need to be in the same (or compatible) key.
- Writing a remix: Knowing the original key helps you write new chords or a new melody that fits naturally.
How does Song Splitter detect key?
Song Splitter uses the Krumhansl-Schmuckler algorithm — one of the most well-established methods in music information retrieval. It works by:
- Computing a chromagram of the audio — a representation of how much energy is present at each of the 12 musical pitch classes (C, C#, D, D#, etc.) across the track.
- Comparing the averaged chromagram against reference profiles for all 24 possible keys (12 major + 12 minor), using a correlation score.
- The key with the highest correlation is reported.
This method is accurate on most well-recorded music. It can be confused by heavily chromatic pieces or atonal compositions.
Camelot Wheel — for DJs
Many DJs use the Camelot Wheel system (popularised by Mixed In Key software) which assigns each musical key a number and letter code. Compatible keys are adjacent on the wheel. For example, 8A (A minor) mixes well with 8B (C major) or 7A (D minor).
Song Splitter displays keys in standard notation (e.g., "A Minor"). You can cross-reference with a Camelot Wheel chart to find compatible keys for mixing.