The Web MIDI API is quite small, so I think it might be worth turning your README into a quick introduction. It would help users if they knew that the API is going to be easy to use, and that there are no unfathomed depths awaiting them.
You cover most of the API already, but I think the README could be much improved by being more explicit here and there. I'm not suggesting a complete re-write, just that the code examples be reviewed.
(I've just compared the sample code in the README with the Web MIDI API W3C Editors Draft 10 January 2013.)
getInput() can take the following types of argument:
a port, e.g.: getInput( inputs[0] ),
a string, e.g.: getInput( input[0].name) or getInput("My Keyboard"),
the index of the port in the inputs enumeration, e.g.: getInput(0).
getOutput() can take the same types of argument as getInput().
the note off example (last line) should have non-zero velocity:
o.send( [ 0x80, 0x45, 0x7f ] ); // send A4 note off immediately
maybe the note off example could be an example of a send with a timestamp.
For example, the following code sends a note off after a delay of 1 sec.:
var now = window.performance.now();
o.send( [ 0x80, 0x45, 0x7f ], now + 1000 );
You could provide an example onerrorcallback() function.
The Web MIDI API is quite small, so I think it might be worth turning your README into a quick introduction. It would help users if they knew that the API is going to be easy to use, and that there are no unfathomed depths awaiting them. You cover most of the API already, but I think the README could be much improved by being more explicit here and there. I'm not suggesting a complete re-write, just that the code examples be reviewed. (I've just compared the sample code in the README with the Web MIDI API W3C Editors Draft 10 January 2013.)