Music Software Development

MIDI player with piano roll

Open a Standard MIDI File to see every note on a piano roll and hear it played back. The file is decoded and played on your device; it is never uploaded. The sound comes from a small built-in preview synth made of plain oscillators and noise bursts, so it shows you the notes, timing and dynamics, not the General MIDI instrument sounds a sound module or DAW would use.

You can also drag a file onto this box.

Want the numbers behind the notes? Open the same file in the MIDI file analyzer. Need something to play? The MIDI test files page has small files built for checking software.

How the player turns ticks into seconds

A MIDI file counts time in ticks, and the header says how many ticks make a quarter note. Seconds only appear once tempo is known, and tempo can change many times. The player gathers every Set Tempo event into a tempo map, then converts each note's start and end tick by adding up the time spent in each tempo region before it. A file with no tempo events plays at 120 BPM, the default the format defines. The MIDI file format guide explains delta times and the header in detail.

How notes are scheduled

Browser timers are not precise enough to start a note exactly on time, so the player never plays a note "now". A timer wakes up every 25 milliseconds and hands the audio engine every note that starts within the next 0.2 seconds, each stamped with an exact time on the audio clock. The audio thread then starts them sample-accurately, and late timer callbacks do not cause audible drift. The Web Audio timing guide walks through this look-ahead pattern. To protect your speakers and the processor, at most 64 voices sound at once; on a very dense file the oldest notes are cut short to make room.

Why it sounds different from your DAW

A MIDI file holds instructions, not audio. What you hear depends on the instrument that receives them. A DAW or General MIDI sound module maps program 0 to a sampled piano and channel 10 to a drum kit; this page maps programs only to a few waveform families and plays drums as short synthetic hits. It also ignores controllers such as sustain pedal, pitch bend, volume and pan, so held chords, slides and mixes will sound plainer than intended. Use it to check timing, structure and which parts play where, then use a full instrument for the real sound.