
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
midi-json-parser
Advanced tools
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 for example be used to pass it on to the midi-player. It can also be encoded again as a binary MIDI file 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:
import { parseArrayBuffer } from 'midi-json-parser';
// Let's assume there is an ArrayBuffer called arrayBuffer which contains the binary content of a
// MIDI file.
parseArrayBuffer(arrayBuffer).then((json) => {
// json is the JSON representation of the MIDI file.
});
In case you are comfortable with TypeScript, this is the interface which describes the JSON representation:
interface IMidiFile {
division: number;
format: number;
tracks: TMidiEvent[][];
}
The type
TMidiEvent
is a union of all possible MIDI events. Here is the complete list of all MIDI events this module can handle:
IMidiChannelPrefixEventIMidiChannelPressureEventIMidiControlChangeEventIMidiCopyrightNoticeEventIMidiDeviceNameEventIMidiEndOfTrackEventIMidiInstrumentNameEventIMidiKeyPressureEventIMidiKeySignatureEventIMidiLyricEventIMidiMarkerEventIMidiMidiPortEventIMidiNoteOffEventIMidiNoteOnEventIMidiPitchBendEventIMidiProgramChangeEventIMidiProgramNameEventIMidiSequencerSpecificEventIMidiSetTempoEventIMidiSmpteOffsetEventIMidiSysexEventIMidiTextEventIMidiTimeSignatureEventIMidiTrackNameEventIMidiUnknownTextEventDeveloping 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 detailed specification of the MIDI file format as HTML: Standard MIDI-File Format Spec. 1.1, updated and PDF: Standard MIDI-File Format Spec. 1.1, updated
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 JavaScript MIDI parser and synthesiser: jasmid - A Javascript MIDI file reader and synthesiser and its excluded parser: midi-file-parser
A complete MIDI app which also contains a parser: MIDI.js
A very similar parser but for Node.js only MIDI Converter
A parser for converting MIDI into a JavaScript object which can also turn it back into a binary MIDI file again: MIDIFile
FAQs
This module is parsing midi files into a human-readable JSON object.
The npm package midi-json-parser receives a total of 231 weekly downloads. As such, midi-json-parser popularity was classified as not popular.
We found that midi-json-parser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.