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 event | Count in file | Meaning |
|---|---|---|
| Tempo (FF 51 03) | 1 | the BPM you typed |
| Time signature (FF 58 04) | 1 | hardcoded 4/4 |
| Key signature (FF 59 02) | 0 | never 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:
| Input | Detected note names | Key label produced? |
|---|---|---|
| C4 D4 E4 F4 G4 A4 B4 C5 | C4 D4 E4 F4 G4 A4 B4 C5 | none |
| D4 E4 F#4 G4 A4 B4 C#5 D5 | D4 E4 F#4 G4 A4 B4 C#5 D5 | none |
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:
- No analysis step. Key detection means counting how often each scale degree appears and finding the tonic — a whole algorithm that is simply not in the code. The detector stops at “what pitch is this frame?”
- The note set is noisy. A real conversion includes wrong and extra notes, especially in polyphonic mode or on noisy audio. A clean scale is the easy case; a real song returns a messy pitch set where the true key is buried among errors. You would have to clean it first — see How to clean up a converted MIDI.
- Enharmonic ambiguity. A MIDI note is just a number. C♯ and D♭ are the same value, so the note names alone cannot tell whether a passage is in A major or F♯ minor. Naming the key needs spelling context the converter never has.
- One flat note list. Chords, bass and melody are all flattened into a single channel with no track separation, so the vertical pitch-class collections a key detector relies on are mixed with everything else.
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:
- Export the CSV. It has a
note_namecolumn — the exact pitches the detector found, in time order. - 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.
- 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.
- 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
- 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.
- 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.
- 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:
| Input notes | Readout | Correlation |
|---|---|---|
| C major scale, 8 notes | C major / 8B | 90% |
| A natural minor scale, 8 notes | A minor / 8A | 87% |
| D major scale, 8 notes | D major / 10B | 90% |
| A single C4 | C major / 8B | 68% |
| Quiet C-major triad plus one loud, long C#4 | C# minor / 12A | 69% |
| Empty note list | null (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:
- Stay on this page if your question is why a DAW shows no key after import: the writer emits only tempo (
FF 51), 4/4 time signature (FF 58) and end-of-track (FF 2F) — 0 key-signature events. - Use the key readout on this site if you want a name and a Camelot code: it needs the detected notes, works from a file you upload, and still writes 0 key-signature events into the exported
.mid. - Open a DAW or notation app if the key must live in the file, or if the piece modulates: this is a single global correlation, and the writer has no place to put a key change. The byte-by-byte anatomy of the exported file shows every event type available.
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.