10 1 / 2013
MIDI.js works by providing an API that you can use to create notes, chords, adjust dynamics and more. It generates audio using something called a SoundFont, which is a file format containing samples for each note for one or more instruments. These SoundFont files can be rather large as you might imagine, so you may see a loading progress indicator while the above demos load them.
Once the SoundFont has been loaded, MIDI.js needs a source of input. This can be you, directly calling API methods via a virtual instrument, or taken from a MIDI file. MIDI.js uses another library called jasmid, which can read the binary MIDI file and generate MIDI events which MIDI.js can then use to synthesize the sounds you hear from your speaker.