MIDI File Inspector
See what is inside a MIDI file: tracks, instruments, tempo map, notes, length and an estimated key.
How it works
Reads a Standard MIDI File (.mid, format 0, 1 or 2) and lists its tracks with channels, General MIDI instruments, note counts and ranges, the tempo map, time and key signatures, note lengths, the most notes sounding at once, drum hits and an estimated key from the pitch content. Includes a piano-roll overview. The same reader Tickwork uses to import MIDI files.
- The file is parsed byte by byte following the Standard MIDI File 1.0 specification: header chunk, track chunks, variable-length delta times, running status, meta and SysEx events. Unknown chunks are skipped; RIFF-wrapped files (.rmi) are unwrapped.
- Notes are paired from note-on to the next note-off of the same key and channel (a note-on with velocity 0 counts as a note-off). Times in seconds use the tempo map (120 BPM until the first tempo event); SMPTE files use frames per second instead.
- The key estimate correlates the duration-weighted pitch-class histogram of all pitched notes (channel 10 excluded) with the Krumhansl–Kessler major and minor key profiles in all 24 keys and reports the best and second-best match.
- Polyphony is the largest number of notes sounding at the same moment across all tracks; note lengths are given in beats (quarter notes).
The key is a statistical estimate from the notes, not an analysis of harmony; modal or atonal music often gets a nearby major or minor key.
Sources
- Standard MIDI Files 1.0 (RP-001) (MIDI Association)
- General MIDI 1 sound set and percussion key map (MIDI Association)
- Krumhansl, C. L. (1990): Cognitive Foundations of Musical Pitch — key-finding algorithm (Oxford University Press)
Part of Tickwork
-
Tickwork MIDI step & piano-roll sequencer
Sequence synths and drums with a piano roll, chance, ratchets and parameter locks.
Related tools
- MIDI Quantizer with Swing – Tighten the timing of a MIDI file to a grid, with strength, swing and a window that keeps the feel.
- Euclidean Rhythm Generator (MIDI) – Spread k beats evenly over n steps for several drums at once and download the groove as a MIDI file.
- Tonegrid Scale and Sequence Planner – Map a scale to a note grid and plan your melody.
How to use the MIDI File Inspector
See what is inside a .mid file before you import it — tracks, channels, instruments, tempo map, length, drum hits and an estimated key — with a piano-roll preview.
What it is for
A MIDI file contains no sound, only instructions: which note starts when, how hard it is played, which instrument each channel uses and how the tempo changes. Before you import a downloaded file, it helps to know how many tracks it has, which one is the drums, how long it lasts and what key it is in.
The MIDI File Inspector reads Standard MIDI Files (format 0, 1 and 2, also the RIFF .rmi wrapper) up to 4 MB and shows a summary, a per-track table and a piano-roll picture of every note. It uses the same MIDI reader as the import of the Tickwork sequencer app, so a file that opens here also opens there.
The tool does not play or repair files; a truncated file is rejected with a sentence that says where it ends.
Worked example
Choose the sample Lo-fi song (a four-bar song exported from Tickwork) and press the button. The summary reads "lofi-song.mid: format 1, 4 tracks, 102 notes, 11.707 s at 82 BPM, estimated key C major."
The track table shows why there are four tracks for three instruments: track 1 holds only the tempo and time signature, as format 1 files usually do. Track 2, Drums, plays 53 notes on channel 10 between C2 and F♯2 — on channel 10 those numbers are drum sounds, and the drum list translates them: 31 closed hi-hats, 13 bass drums and 9 snares. Keys has 34 notes from D3 to G4, Bass 15 notes from D2 to B2. The highest number of notes sounding at the same moment is 7: a chord in the keys plus bass and drums.
The key estimate is C major with a correlation of 0.66; the runner-up E minor follows closely at 0.653. A small gap like this means the notes fit both keys almost equally well, so treat the answer as a suggestion.
How to read the result
- Format 0 puts everything in one track, format 1 has parallel tracks, format 2 independent sequences (rare). PPQ is the timing resolution in ticks per quarter note.
- Length is the time of the last note-off with the tempo map applied; bars assumes the first time signature.
- Tempo changes and time signatures list every change with its tick and time in seconds.
- Estimated key compares the duration-weighted pitch-class histogram with the Krumhansl–Kessler key profiles; drum channels are ignored. A key signature stored in the file is listed separately, because many files carry none or a wrong one.
- In the track table, Program names the General MIDI instrument family, so you can tell a bass from a pad without listening.
- The piano roll draws every note as a bar (time from left to right, pitch from bottom to top) with one colour per track, so you can see at a glance which track plays where.
Tips and common mistakes
- A format 1 file with an empty first track is normal: that is the conductor track with the tempo map.
- Many files from notation programs have a key signature of C major whatever the music is; trust the estimate more when its correlation is above about 0.7 and clearly above the runner-up.
- Drum notes outside channel 10 are counted as pitched notes. If a "melody" has a range of C2–F♯2 and very short notes, it is probably a drum track on the wrong channel.
- Files above 4 MB or with more than 400,000 events are rejected to protect the server; split long files first.
FAQ
Does the inspector change my file?
No. It only reads the file and creates a report and a picture; your file is never rewritten.
Why does the length differ from my DAW?
The inspector stops at the last note-off. DAWs often round up to the next bar or include an end-of-track event that comes later.
Can it read karaoke (.kar) files?
Yes, if they are Standard MIDI Files with another extension — rename them to .mid. Lyrics are not shown.
Which tool should I use next?
To tighten the timing of the file, use the MIDI Quantizer with Swing. To edit the notes, import the file into the Tickwork app.
Guide last updated:
For scripts and AI agents
- JSON API:
POST https://tickworkmidiinspector.usefulweb.app/api/v1/calculate(same calculation as this page) - Interface description: OpenAPI 3.1 · AI guide: llms.txt
- MCP server (Streamable HTTP):
https://tickworkmidiinspector.usefulweb.app/mcp· tool nametickwork_midi_inspector
Example request
curl -s -X POST https://tickworkmidiinspector.usefulweb.app/api/v1/calculate \
-H 'content-type: application/json' \
-d '{"sample":"lofi-song"}'