midievents
Decode/encode MIDI events.
What it does
- Decode MIDI events
- Check MIDI events (using
strictMode
) - Calculate needed buffer to encode MIDI events
- Encode MIDI events
What it doesn't do
- Reading MIDI files. It's the role of the MIDIFile project.
- Playing MIDI files. It's the role of the MIDIPlayer project.
Usage
// Your variable with an ArrayBuffer instance containing your MIDI eventsvar anyBuffer; // Parse MIDI eventsvar events = ;var parser = anyBuffer 0 false;var event = parsernext; do events; event = parsernext; whileevent; // Check bufffer size before encodingifanyBufferlength >= MIDIEvents console; // Encode MIDI eventsvar destination = anyBuffer;MIDIEvents;
Contributing / Testing
Install them and run the following command :
npm install --devsu npm install grunt-cli -ggrunt test
Contributing
- Feel free to PR
- If you find MIDI events the library can't read, create a test an do a pull request. I'll work on it asap.
- Run
npm run
to get a list of useful development commands.