Audio → MIDI

Audio to MIDI Converter

Does audio to MIDI tell you the key?

The short answer: no — this converter does not detect key or scale. It writes the notes it finds (pitch, time, velocity), not an analyzed key. We measured the exported .mid and it contains zero key-signature events; a C-major scale comes back as the note names C4–C5, never as the label “C major.” What you get is the raw material to work the key out yourself — the note list — not the key itself.

1. What the file actually contains

A Standard MIDI file from this converter is format 1, two tracks, 480 ticks per quarter note. The detection code (dsp.js) measures pitch and timing; the writer (midi.js) emits note-on/note-off pairs plus exactly two meta events: a tempo and a 4/4 time signature. There is no step anywhere that examines the set of notes and decides a tonic. We wrote a file and inspected its meta events directly:

Meta events present in the converter's own .mid output.
Meta eventCount in fileMeaning
Tempo (FF 51 03)1the BPM you typed
Time signature (FF 58 04)1hardcoded 4/4
Key signature (FF 59 02)0never written

The key-signature event count is zero. So whatever your DAW shows for “key” after import is its own guess (or nothing) — the file carries no key information to read. For the full byte layout, What is actually inside a MIDI file breaks the whole thing down.

2. Measurement: you get pitches, not a key

We fed two clean scales through the converter’s own detector and read back the note names it produced:

A C-major scale and a D-major scale through the converter's own code.
InputDetected note namesKey label produced?
C4 D4 E4 F4 G4 A4 B4 C5C4 D4 E4 F4 G4 A4 B4 C5none
D4 E4 F#4 G4 A4 B4 C#5 D5D4 E4 F#4 G4 A4 B4 C#5 D5none

Both came back note-for-note as played — eight names each, with the sharps in the right places — but in neither case did the converter say “C major” or “D major.” It hands you the scale; it does not name it. The output is a list of pitches, which is exactly the input a key-detection step would need — except that step does not exist in this pipeline.

3. Why it cannot name the key

Four boundaries stop a converter built this way from reporting a key:

4. How to find the key yourself

The note list is enough to work it out — you just do the last step the converter skips:

  1. Export the CSV. It has a note_name column — the exact pitches the detector found, in time order.
  2. Strip the noise first. Delete obvious errors and ghost notes so you are looking at the real pitch classes. A clean list makes the key obvious; a dirty one hides it.
  3. Look at the most frequent pitch classes. The tonic and the notes of its scale show up most often. A run of C–D–E–F–G–A–B with C dominant points to C major; the same classes with a C♯ vs D♭ spelling question are where you apply your ear.
  4. Or let a DAW do it. Most DAWs have a key-detection feature that reads the pitch content. Feed it the cleaned MIDI and it will name the key — using the pitches this converter already gave you.

The point: the converter’s job ends at pitches. Key is a downstream inference, and the file gives you everything needed to make it, just not the answer.

If you would rather have the name computed for you, the BPM finder on this site also reports a key and its Camelot code from the same detected notes. The measured limits of that readout are in section 6 — including the case where a single note is enough to produce a full key label.

5. How to check on your own file

  1. Inspect the .mid meta. Open it in any MIDI viewer; you will see a tempo and a 4/4 time signature and no key-signature event — confirming the converter wrote none.
  2. Read the CSV note names. Those are your pitches. If they spell a scale, you have the raw key material; if they are a messy song, clean them before inferring.
  3. Don’t trust a DAW’s auto-key on a raw export. Until you have removed the spurious notes, any auto-detected key is reading the noise too.

6. "Song key finder" and "how to find the key of a song": which page here actually names a key

Short answer: the main converter on this site does not name a key — its .mid contains zero FF 59 key-signature events — but another page on this site does. The BPM finder takes the notes the same detector found and returns a key name plus its Camelot code. There is no contradiction: this page is about what the file does not carry; that page is about a readout computed from the note list, which is never written into the file.

The readout uses a pitch-class histogram, not a score. Each detected note contributes max(0, end − start) × velocity to one of 12 bins; the histogram is correlated against all 24 rotations of the Krumhansl-Schmuckler major and minor profiles, and the best Pearson correlation wins. The root is then mapped to the Camelot wheel. We ran the page's own function on known note lists:

Known note lists through this site's own key function
Input notesReadoutCorrelation
C major scale, 8 notesC major / 8B90%
A natural minor scale, 8 notesA minor / 8A87%
D major scale, 8 notesD major / 10B90%
A single C4C major / 8B68%
Quiet C-major triad plus one loud, long C#4C# minor / 12A69%
Empty note listnull (no readout)—

Two honest limits fall straight out of that table. A single note is enough to produce a full key label, so the percentage is a profile correlation, not a probability that the key is right. And because duration and velocity both weight the bins, one loud sustained wrong note can flip the winner — which is why cleaning ghost notes out of a conversion matters before you ask any tool to name a key. A MIDI note number also cannot distinguish C♯ from D♭, so enharmonic spelling is never recoverable from this data.

Which route is yours:

Where harmonic-analysis tools differ

Dedicated key and chord analysis can model progressions, modulations and enharmonic spelling from a score or a full mix. This site's readout is one correlation over one pitch-class histogram built from a browser FFT detector with a 55 Hz floor and a 6-peak-per-frame ceiling. If the input is already notation, your notation app already knows the key; if it is audio, the file structure the notes are written into is the thing to check before expecting a key label to survive an export.

Questions people actually ask

Will the converter tell me what key my song is in?

No. It outputs the notes it detects, not an analyzed key. The exported file has no key-signature event, and the note list comes back as pitch names (C4, D4…) with no "C major" label attached.

Why doesn't it just detect the key?

Because key detection is a separate algorithm — counting scale-degree usage and finding the tonic — that is not part of this converter's pipeline. The detector stops at per-frame pitch; it never looks at the collection of notes as a whole.

Can I get the key from the note names?

Yes, that is exactly what the note list is for. Export the CSV, clean the obvious errors, and the most frequent pitch classes point to the tonic and scale. A DAW's key-detection feature will do the same from the cleaned MIDI.

My DAW shows a key after importing. Is that from the converter?

No. The .mid carries no key information, so whatever your DAW displays is its own inference from the note content — or a default. It is reading the pitches the converter gave you, not a key the converter wrote.

Does polyphonic or monophonic mode affect key detection?

Neither produces a key — key detection is absent in both. The modes only change which notes you get (one line vs chords); you still have to name the key yourself from the resulting note list.

Drop a file in and read the CSV — the Audio to MIDI Converter runs entirely in your browser, so the note names you get are the honest, checkable raw material for finding the key yourself. Once the pitches are right, How to clean up a converted MIDI before you use it walks the passes that turn a raw export into a usable part.

Related guides