Greetings. In Elm 0.18 I did
Would it be possible to get MIDI back via elm-explorations? I’d be happy to collaborate on this (or to have someone more experienced do it). The necessary API should be about as trivial as they come – while the complete Web MIDI API has a fair bit of stuff in it, the only thing we really need to get started is to recognize when MIDI controllers are plugged into USB and to read MIDI messages from them. The stuff in
native.js is all the impure stuff you need for a useful application. Maybe add a polyfill for compatibility with more browsers and some idiomatic error handling.
Each MIDI message coming in from the Web MIDI API is just a raw byte string. The message can be parsed in pure-functional code – the great
elm-comidi library already does that.
(It should be noted that the Web MIDI API is wholly separate from the Web Audio API, the latter being more complex.)