Sample MIDI files
Two Standard MIDI Files written byte by byte by our own code: a format 0 file with a C major scale of 8 notes on piano, and a format 1 file with a tempo track, a melody on channel 1 and a bass line on channel 2. Free, no sign-up. Updated 28 November 2026.
What these files are
Two Standard MIDI Files written byte by byte by our own code: a format 0 file with a C major scale of 8 notes on piano, and a format 1 file with a tempo track, a melody on channel 1 and a bass line on channel 2. Both last 4 seconds at 120 beats per minute.
Every file was generated by our own code, so nothing in them is copied from anyone, and we release them under CC0: use them for anything. The facts in the table were read back from each file after it was written, not typed in by hand.
About the format
A Standard MIDI File holds instructions, not sound: which note to start or stop, on which channel, and when. It starts with an MThd chunk giving the format (0 = one track, 1 = several tracks played together), the number of tracks and the timing division, here 480 ticks per quarter note. Each MTrk chunk is a list of events, each preceded by a variable-length delta time. A note-on with velocity 0 counts as a note-off. The sound you hear depends on the synthesizer that plays the file.
These files open in GarageBand, MuseScore, Logic, FL Studio, Windows Media Player and VLC with a soundfont. A web server should send them with the header Content-Type: audio/midi; related extensions: .midi, .smf.
2 files to download
| File | Size | What it is |
|---|---|---|
| sample-c-major-scale.mid | 125 B | format 0, one track: a C major scale, 8 quarter notes at 120 bpm (4 seconds), piano midi format: 0; tracks: 1; ticks per quarter: 480; notes: 8; duration s: 4.0 |
| sample-2-instruments.mid | 198 B | format 1, tempo track + melody (channel 1, piano) + bass (channel 2, acoustic bass), 4 seconds at 120 bpm midi format: 1; tracks: 3; ticks per quarter: 480; notes: 12; duration s: 4.0 |
MIME type: audio/midi. Total 323 B.
Good for testing
- MIDI parsers and players
- Music notation and DAW imports
- Learning how delta times, note-on and note-off events work
Check a file
xxd -l 14 sample-c-major-scale.mid # MThd, header length 6, format, tracks, 480 ticks per quarter
python -c "import mido; print(mido.MidiFile('sample-2-instruments.mid').length)"Compare the SHA-256 checksum to make sure the download is complete and unchanged (sha256sum file on Linux, shasum -a 256 file on macOS, certutil -hashfile file SHA256 on Windows):
| File | SHA-256 |
|---|---|
| sample-c-major-scale.mid | 6a1c5f351f8fbaf0fb1fdb033efe7fed28f74aa4cbbac080e6036e85b84038e4 |
| sample-2-instruments.mid | 74b3541aea8c59deebb5284f61bba3825fabb6ee4eaca864ef5468302a209fb3 |