MIDI tutorial
Follow a note from a keyboard through a MIDI message, synthesizer and file.
Learn how MIDI messages work, write a MIDI file, and turn code into audio you can hear in your browser.
Open the step sequencer →Follow a note from a keyboard through a MIDI message, synthesizer and file.
Model notes, tracks and tempo using integer ticks.
Choose browser or native libraries for audio and MIDI.
Encode a measure, pitched notes and rests for notation software.
Read Note On, Note Off and Control Change messages.
Build a format 0 track and translate musical time into ticks.
Use the audio clock to play patterns without depending on timer accuracy.
Convert MIDI note numbers into pitches and frequencies, then hear the result.
Build a one-bar melody, hear it, and export a .mid file.