← Back to HomeNote

How HomeNote finds the key, and how we tested it.

Two parts. First, what HomeNote does with your audio, stage by stage, shown on a real song. Second, the test behind the accuracy chart: songs HomeNote had never heard, labelled by people who had nothing to do with HomeNote, with every tool run the same way on the same computer, and every answer published.

How HomeNote listens

Five stages run continuously while the track plays. Every picture below is real output from the plugin's analysis code, run on one of the 684 test songs: “The Discovery” by BrokeMC, a hip-hop track the experts label F minor (CC BY 3.0 US, from the Free Music Archive). HomeNote's answer for it is F minor.

1

Measure the tuning

The audio is mixed to mono at 22.05 kHz. An 8,192-point FFT (2.7 Hz per bin) finds the spectral peaks in each frame and groups them into fundamentals. Every fundamental between 70 and 2,300 Hz votes for how far it sits from the nearest note of the A = 440 grid, in half-cent bins. The peak of that histogram is the track's tuning. For this song it is -4.5 cents, so A = 438.9 Hz.

-50-250+25+50 A = 440 Hz grid detected: -4.5 cents → A = 438.9 Hz distance of each detected pitch from the nearest A = 440 note, in cents (100 cents = 1 semitone)-50-250+25+50 detected: -4.5 cents → A = 438.9 Hz A = 440 Hz grid distance of each detected pitch from thenearest A = 440 note, in cents(100 cents = 1 semitone)
2

Turn the drums down

A constant-Q transform measures 252 pitch bins, 36 per octave from C1 up, every 46 ms. Each bin is then compared with its neighbours two ways: a median across 13 frames in time (about 0.6 s) keeps what is held, and a median across 37 bins in pitch (about an octave) keeps what is a broadband hit. Bins that look like hits are turned down to as little as 15%, never to zero. Drag across the picture to compare. In these twelve seconds the weighting removes 44% of the spectrum's magnitude.

Drag the handle: before on its left, after on its right
Spectrogram of twelve seconds of the song after the weighting, low notes at the bottom. The horizontal note lines remain; the vertical drum streaks are mostly gone The same twelve seconds as measured. Horizontal lines are held notes; many bright vertical streaks are drum hits
quietloud
3

Fold into twelve notes

The cleaned spectrum is folded octave over octave into the twelve note names, shifted by the tuning from step 1 so each bin lands on the right note. A second copy keeps only the low register, for the bass. Real music is never as clean as a textbook diagram: every note has some energy, and the key shows up as seven notes standing above the other five.

0.99C0.77C#0.60D0.81Eb0.65E1.00F0.69F#0.83G0.82Ab0.62A0.71Bb0.63B ■ the seven notes of F minor ■ the five notes outside it (strongest note = 1.00)C0.99C#0.77D0.60Eb0.81E0.65F1.00F#0.69G0.83Ab0.82A0.62Bb0.71B0.63■ the seven notes of F minor■ the five notes outside it(strongest note = 1.00)
4

Two readers score all 24 keys

Three small convolutional networks read the cleaned spectrum directly, in 186 ms steps, and their probabilities are averaged. Separately, a profile reader scores the twelve-note picture, the bass notes and the chord sequence against learned key profiles. The two are blended in the log domain, 70% networks and 30% profiles. Here both readers agree, and the blend gives F minor 80%.

three networks, averagedprofile readerblend (70 / 30)F minor77.6%82.2%80.0%Ab major9.5%4.7%7.8%C minor5.7%7.0%6.1%C# major1.5%1.9%1.6%F major0.8%2.3%1.1%other 19 keys5.0%1.9%3.3%three networks, averagedF minor77.6%Ab major9.5%C minor5.7%C# major1.5%F major0.8%other 19 keys5.0%profile readerF minor82.2%Ab major4.7%C minor7.0%C# major1.9%F major2.3%other 19 keys1.9%blend (70 / 30)F minor80.0%Ab major7.8%C minor6.1%C# major1.6%F major1.1%other 19 keys3.3%
5

Show a key only when it's sure

A calibrated model turns the blend into the chance that the notes are right, counting the key and its relative together because Auto-Tune corrects both the same way. The plugin shows the key only above 80%. This is the live reading for the whole song, checked once a second: it first clears the bar at 15 seconds, falls back under it two seconds later, clears it again at 29 seconds and stays there, settling near 91%. The key was on screen for 91% of the song. Move the pointer along the line, or tap it, to read any second.

0%50%100%0:001:002:003:004:005:00 80%: key shown above this line first shown at 15 s time into the song (min:sec) ─ key shown ─ held back, top three shown as “Could be”0%50%100%0:001:002:003:004:005:00 80%: key shown above this line first shown at 15 s time into the song (min:sec)─ key shown─ held back, top three shown as “Could be”

Results

Two ways to count the same 684 songs. On the left, a song counts when the tool's main answer is the experts' exact key. On the right, it counts when that key is anywhere on screen: HomeNote lists its top three, and Auto-Key 2 has a switch that flips its answer to the relative key.

Exact key found
HomeNote67.7%
463 of 684 songs
Auto-Key 258.5%
400 of 684 songs
libkeyfinder53.9%
369 of 684 songs
Right key on screen
HomeNote83.8%
573 of 684: in its top three
Auto-Key 264.5%
441 of 684: its answer or its relative-key switch
libkeyfinder53.9%
369 of 684: it gives one answer

Song by song

HomeNote and Auto-Key 2 agree on most songs. Where only one of them is right, it is HomeNote on 89 songs and Auto-Key 2 on 26.

HomeNote and Auto-Key 2, song by song · 684 songs
  • Both right 374
  • Only HomeNote right 89
  • Only Auto-Key 2 right 26
  • Neither right 195

What the wrong answers were

Not all misses are equal. A relative key (A minor for C major) uses the same seven notes, so Auto-Tune corrects the same way. A fifth away is one note different. The same root with the wrong major or minor is three notes different.

Where every answer landed · 684 songs each
  • Exact key
  • Relative key (same notes)
  • A fifth away (one note off)
  • Same root, wrong major/minor
  • Something else
HomeNote
Auto-Key 2
libkeyfinder

Major and minor

A key finder that leans toward one mode scores well on those songs and badly on the others. The closer the two dots, the more even-handed the tool. libkeyfinder gets 38.5% of major-key songs; HomeNote and Auto-Key 2 are within 7 and 4 points across the two.

Exact key by the song’s true mode · 262 major, 422 minor
  • Major-key songs
  • Minor-key songs
HomeNotemajor 63.4%minor 70.4%
Auto-Key 2major 60.7%minor 57.1%
libkeyfindermajor 38.5%minor 63.5%
0%50%100%

The numbers.

HomeNoteAuto-Key 2libkeyfinder
Exact key, all 684 songs67.7%58.5%53.9%
Exact key, hip-hop half62.9%53.2%53.2%
Exact key, other half72.5%63.7%54.7%
Main key or its relative (same notes, same Auto-Tune correction)73.1%64.5%60.7%
Right key shown on screen83.8% in its top 364.5% main or relative switch53.9% one answer
Standard partial-credit score (MIREX)72.065.861.9

How sure we are: resampling the songs 3,000 times, HomeNote's lead over Auto-Key 2 on exact key stays between +6.1 and +12.4 points (95% range). Song by song, HomeNote was right on 89 songs Auto-Key 2 missed, and Auto-Key 2 was right on 26 HomeNote missed.

The songs

684 full songs from the Free Music Archive, keyed by music experts in the FMAK dataset (Stella Wong, ISMIR 2023; zenodo.org/records/10719860). None of them were used to train, tune or test HomeNote before this test.

  • 342 hip-hop songs: every FMAK song tagged hip-hop, rap, alternative or abstract hip-hop, or hip-hop beats.
  • 342 songs from everything else, spread evenly across rock, electronic, folk, pop, instrumental, classical, experimental, international, jazz, country, R&B, blues and older recordings (smaller genres gave all they had). Picked at random with a fixed seed.
  • The answer key is the experts' label. A tool is right only if it names that exact key.

The setup

  • One computer for everything: a 2017 iMac Pro running Windows (Boot Camp), with the same audio files.
  • HomeNote: the Windows release build, given each whole song.
  • Auto-Key 2 (Antares; its detection engine is zplane's TONART v3): its File Mode in FL Studio, which analyzes the whole file. The key was read off its display, with a check that the display showed the right file name before each answer was recorded.
  • libkeyfinder: the open-source engine inside Mixxx and KeyFinder, built from source with its default settings, given each whole song.

What this doesn't show

  • One label per song. Some songs are honestly ambiguous, and an expert's call decides "right" for every tool alike.
  • Auto-Key 2 was tested in File Mode only, its whole-file analysis. Its Listen Mode wasn't tested.
  • Accuracy isn't everything: Auto-Key 2 sends its settings straight into Auto-Tune, and HomeNote doesn't.
  • A test set we built ourselves on short vocal loops is left out until we've confirmed none of it overlaps HomeNote's training material.

Check it yourself

The audio itself comes from the public FMAK and FMA datasets; each song keeps its artist's Creative Commons licence, so we link to it rather than re-share it.

Auto-Tune and Auto-Key are trademarks of Antares Audio Technologies. HomeNote is an independent project, not affiliated with Antares.