This module is parsing midi files into a human-readable JSON object.
This module parses a binary MIDI file and turns it into a JSON representation. This JSON representation can then be used to pass it on to the midi-player. It can of course also be modified to be encoded as binary MIDI file at some point again by using the json-midi-encoder.
This module is available on npm and can be installed by running the following command:
npm install midi-json-parser
Once the module is installed you can use its one and only function as shown in the example below:
;// Let's assume there is an ArrayBuffer called arrayBuffer which contains the binary content of a// MIDI file.;
In case you are comfortable with TypeScript, this is the interface which describes the JSON representation:
is a union of all possible MIDI events. Here is the complete list of all MIDI events this module can handle:
Developing this module wouldn't have been possible without all the great resources out there. The following list tries to mention a few of them:
A brief description of the MIDI file format: Outline of the Standard MIDI File Structure
A blog post about the timing information in MIDI files: Timing in MIDI files
An explanation of the concept called running status: Running Status
Actually a documentation for a Python library, but it also contains extensive information on MIDI messages itself: Mido - MIDI Objects for Python
Very detailed information on meta messages, but also on many other non MIDI related audio topics as well: RecordingBlogs.com Wiki
A complete MIDI app which also contains a parser: MIDI.js
A very similar parser but for Node.js only MIDI Converter