MIDI.js - Home
The 100% JavaScript MIDI Player using W3C Web Audio

MIDI.js is a MIDI file player for web pages. It's easy to use and works with all modern browsers on Windows, MacOS, Android and iOS. MIDI.js uses the W3C Web Audio API to produce audio output. This is a 100% JavaScript solution, with no need for plugins or extensions.

For browsers not not yet supporting W3C Web Audio API the MIDI.js library falls back to conventional plugin-based methods to play MIDI files. However, some of the advanced features of MIDI.js are not supported or even cannot be supported in fallback mode.

Advantages of MIDI.js


Play Rock the Jukebox (Alan Jackson)    Play Unchain my Heart (Bobby Sharp)    Play Hinematov (Reiner Oberbeck)    Play Woman in Love (Barbara Streisand)

Stop Playback

MIDI.js status: Initializing ...
MIDI.js audio time (s): -

Include MIDI.js into your website

Using MIDI.js to play MIDI files on your website is as easy as this. Lets assume you have a MIDI file "hinematov.mid" on your website in a directory named "midi".

There are just two steps to let it play:

1. Include the following script statement into your page's header

<script type='text/javascript' src='http://www.midijs.net/lib/midi.js'></script>

2. Create a link to play the file

 <a href="#" onClick="MIDIjs.play('midi/hinematov.mid');">Play hinematov.mid</a>

Optinal: Provide a link to stop playback at any time

 <a href="#" onClick="MIDIjs.stop();">Stop MIDI Playback</a>

As you note,  the script will provide the JavaScript object MIDIjs with functions MIDIjs.play(url) and MIDIjs.stop() to play MIDI files and to stop playback at any time.

More Detailed MIDI.js API Description

Browsers where MDI.js works with Web Audio API

The following browsers have been positively tested. If version x of a browser works you may assume, that version x+1 also works. These are the positive cases. However, I did not make a comprehensive test of all browsers and operating systems that exist.

Microsoft Windows






The following browsers are not supported by MIDI.js. If version x does not work you may assume, that version x-1 also does not work.