I encourage you to work on having MIDI support via a Firefox addon. There
are two opportunities here:
1. Ship the MIDI support via a native binary and use native messaging to
communicate (can be done today)
2. Ship a MIDI API via webextensions in the browser itself (would require
core Firefox hacking)
I recommend starting with #1 and gradually moving towards #2 if the
webextensions team agrees that this is a valuable API surface.