cwilso / WebMIDIAPIShim

Polyfill using the Jazz NPAPI MIDI plugin to implement the Web MIDI API on Mac and Windows.
380 stars 53 forks source link

README issues #16

Closed notator closed 11 years ago

notator commented 11 years ago

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.)

  1. 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).
  2. getOutput() can take the same types of argument as getInput().
  3. the note off example (last line) should have non-zero velocity: o.send( [ 0x80, 0x45, 0x7f ] ); // send A4 note off immediately
  4. 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 );
  5. You could provide an example onerrorcallback() function.
cwilso commented 11 years ago

Fixed: https://github.com/cwilso/WebMIDIAPIShim/commit/25667742e4179b9eb3669522b5e71ae030ed3506.