easy Web MIDI message handler
npm install web-midi-emitter> easy Web MIDI message handler
```
npm install --save web-midi-emitter
- access: MIDIAccess
- deviceNameMatcher: string or RegExp#### Instance methods
-
send(data: number[], [ timestamp: number ]): void
- send midi data to the midi device
- clear(): void#### Events
-
statechange
- emitted when change the state of the midi device
- midimessage
- emitted when receive midi data from the midi deviceHow to use
`js
const WebMIDIEmitter = require("web-midi-emitter");window.navigator.requestMIDIAccess().then((access) => {
const device = new WebMIDIEmitter(access, "Launch Control");
device.on("statechange", (e) => {
console.log(e);
});
device.on("midimessage", (e) => {
console.log(e.data);
});
device.send([ 0x90, 0x64, 0x7f ]);
});
``MIT