{"id":14384646,"url":"https://github.com/chrisguttandin/midi-json-parser","last_synced_at":"2025-04-13T02:23:54.172Z","repository":{"id":8829194,"uuid":"38206989","full_name":"chrisguttandin/midi-json-parser","owner":"chrisguttandin","description":"This module is parsing midi files into a human-readable JSON object.","archived":false,"fork":false,"pushed_at":"2025-04-10T21:13:03.000Z","size":22635,"stargazers_count":119,"open_issues_count":4,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-10T22:23:54.063Z","etag":null,"topics":["midi"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chrisguttandin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-06-28T17:09:16.000Z","updated_at":"2025-04-10T21:13:07.000Z","dependencies_parsed_at":"2023-10-23T12:34:28.295Z","dependency_job_id":"5b157e9f-04de-4461-b0db-a788b72d59a0","html_url":"https://github.com/chrisguttandin/midi-json-parser","commit_stats":{"total_commits":4330,"total_committers":3,"mean_commits":"1443.3333333333333","dds":0.0367205542725173,"last_synced_commit":"265089faece6b14bde06b61dcee185ad73641ef9"},"previous_names":[],"tags_count":280,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisguttandin%2Fmidi-json-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisguttandin%2Fmidi-json-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisguttandin%2Fmidi-json-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisguttandin%2Fmidi-json-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrisguttandin","download_url":"https://codeload.github.com/chrisguttandin/midi-json-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248655024,"owners_count":21140414,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["midi"],"created_at":"2024-08-28T18:01:32.650Z","updated_at":"2025-04-13T02:23:54.134Z","avatar_url":"https://github.com/chrisguttandin.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# midi-json-parser\n\n**This module is parsing midi files into a human-readable JSON object.**\n\n[![version](https://img.shields.io/npm/v/midi-json-parser.svg?style=flat-square)](https://www.npmjs.com/package/midi-json-parser)\n\nThis 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](https://github.com/chrisguttandin/midi-player). It can also be encoded again as a binary MIDI file using the [json-midi-encoder](https://github.com/chrisguttandin/json-midi-encoder).\n\n## Usage\n\nThis module is available on [npm](https://www.npmjs.com/package/midi-json-parser) and can be\ninstalled by running the following command:\n\n```shell\nnpm install midi-json-parser\n```\n\nOnce the module is installed you can use its one and only function as shown in the example below:\n\n```js\nimport { parseArrayBuffer } from 'midi-json-parser';\n\n// Let's assume there is an ArrayBuffer called arrayBuffer which contains the binary content of a\n// MIDI file.\n\nparseArrayBuffer(arrayBuffer).then((json) =\u003e {\n    // json is the JSON representation of the MIDI file.\n});\n```\n\nIn case you are comfortable with TypeScript, this is the interface which describes the JSON\nrepresentation:\n\n```typescript\ninterface IMidiFile {\n    division: number;\n\n    format: number;\n\n    tracks: TMidiEvent[][];\n}\n```\n\nThe type\n[`TMidiEvent`](https://github.com/chrisguttandin/midi-json-parser-worker/blob/master/src/types/midi-event.ts)\nis a union of all possible MIDI events. Here is the complete list of all MIDI events this module can handle:\n\n-   [`IMidiChannelPrefixEvent`](https://github.com/chrisguttandin/midi-json-parser-worker/blob/master/src/interfaces/midi-channel-prefix-event.ts)\n-   [`IMidiChannelPressureEvent`](https://github.com/chrisguttandin/midi-json-parser-worker/blob/master/src/interfaces/midi-channel-pressure-event.ts)\n-   [`IMidiControlChangeEvent`](https://github.com/chrisguttandin/midi-json-parser-worker/blob/master/src/interfaces/midi-control-change-event.ts)\n-   [`IMidiCopyrightNoticeEvent`](https://github.com/chrisguttandin/midi-json-parser-worker/blob/master/src/interfaces/midi-copyright-notice-event.ts)\n-   [`IMidiDeviceNameEvent`](https://github.com/chrisguttandin/midi-json-parser-worker/blob/master/src/interfaces/midi-device-name-event.ts)\n-   [`IMidiEndOfTrackEvent`](https://github.com/chrisguttandin/midi-json-parser-worker/blob/master/src/interfaces/midi-end-of-track-event.ts)\n-   [`IMidiInstrumentNameEvent`](https://github.com/chrisguttandin/midi-json-parser-worker/blob/master/src/interfaces/midi-instrument-name-event.ts)\n-   [`IMidiKeyPressureEvent`](https://github.com/chrisguttandin/midi-json-parser-worker/blob/master/src/interfaces/midi-key-pressure-event.ts)\n-   [`IMidiKeySignatureEvent`](https://github.com/chrisguttandin/midi-json-parser-worker/blob/master/src/interfaces/midi-key-signature-event.ts)\n-   [`IMidiLyricEvent`](https://github.com/chrisguttandin/midi-json-parser-worker/blob/master/src/interfaces/midi-lyric-event.ts)\n-   [`IMidiMarkerEvent`](https://github.com/chrisguttandin/midi-json-parser-worker/blob/master/src/interfaces/midi-marker-event.ts)\n-   [`IMidiMidiPortEvent`](https://github.com/chrisguttandin/midi-json-parser-worker/blob/master/src/interfaces/midi-midi-port-event.ts)\n-   [`IMidiNoteOffEvent`](https://github.com/chrisguttandin/midi-json-parser-worker/blob/master/src/interfaces/midi-note-off-event.ts)\n-   [`IMidiNoteOnEvent`](https://github.com/chrisguttandin/midi-json-parser-worker/blob/master/src/interfaces/midi-note-on-event.ts)\n-   [`IMidiPitchBendEvent`](https://github.com/chrisguttandin/midi-json-parser-worker/blob/master/src/interfaces/midi-pitch-bend-event.ts)\n-   [`IMidiProgramChangeEvent`](https://github.com/chrisguttandin/midi-json-parser-worker/blob/master/src/interfaces/midi-program-change-event.ts)\n-   [`IMidiProgramNameEvent`](https://github.com/chrisguttandin/midi-json-parser-worker/blob/master/src/interfaces/midi-program-name-event.ts)\n-   [`IMidiSequencerSpecificEvent`](https://github.com/chrisguttandin/midi-json-parser-worker/blob/master/src/interfaces/midi-sequencer-specific-event.ts)\n-   [`IMidiSetTempoEvent`](https://github.com/chrisguttandin/midi-json-parser-worker/blob/master/src/interfaces/midi-set-tempo-event.ts)\n-   [`IMidiSmpteOffsetEvent`](https://github.com/chrisguttandin/midi-json-parser-worker/blob/master/src/interfaces/midi-smpte-offset-event.ts)\n-   [`IMidiSysexEvent`](https://github.com/chrisguttandin/midi-json-parser-worker/blob/master/src/interfaces/midi-sysex-event.ts)\n-   [`IMidiTextEvent`](https://github.com/chrisguttandin/midi-json-parser-worker/blob/master/src/interfaces/midi-text-event.ts)\n-   [`IMidiTimeSignatureEvent`](https://github.com/chrisguttandin/midi-json-parser-worker/blob/master/src/interfaces/midi-time-signature-event.ts)\n-   [`IMidiTrackNameEvent`](https://github.com/chrisguttandin/midi-json-parser-worker/blob/master/src/interfaces/midi-track-name-event.ts)\n-   [`IMidiUnknownTextEvent`](https://github.com/chrisguttandin/midi-json-parser-worker/blob/master/src/interfaces/midi-unknown-text-event.ts)\n\n## Acknowledgement\n\nDeveloping this module wouldn't have been possible without all the great resources out there. The\nfollowing list tries to mention a few of them:\n\n-   A detailed specification of the MIDI file format as HTML: [Standard MIDI-File Format Spec. 1.1, updated](http://www.music.mcgill.ca/~ich/classes/mumt306/StandardMIDIfileformat.html) and PDF: [Standard MIDI-File Format Spec. 1.1, updated](http://www.cs.cmu.edu/~music/cmsip/readings/Standard-MIDI-file-format-updated.pdf)\n\n-   A brief description of the MIDI file format: [Outline of the Standard MIDI File Structure](http://www.ccarh.org/courses/253/handout/smf/)\n\n-   A blog post about the timing information in MIDI files: [Timing in MIDI files](http://sites.uci.edu/camp2014/2014/05/19/timing-in-midi-files/)\n\n-   An explanation of the concept called running status: [Running Status](http://www.blitter.com/~russtopia/MIDI/~jglatt/tech/midispec/run.htm)\n\n-   Actually a documentation for a Python library, but it also contains extensive information on MIDI messages itself: [Mido - MIDI Objects for Python](http://mido.readthedocs.org/en/latest/index.html)\n\n-   Very detailed information on meta messages, but also on many other non MIDI related audio topics as well: [RecordingBlogs.com Wiki](http://www.recordingblogs.com/sa/tabid/88/Default.aspx?topic=MIDI+meta+messages)\n\n-   A JavaScript MIDI parser and synthesiser: [jasmid - A Javascript MIDI file reader and synthesiser](https://github.com/gasman/jasmid) and its excluded parser: [midi-file-parser](https://github.com/NHQ/midi-file-parser)\n\n-   A complete MIDI app which also contains a parser: [MIDI.js](https://github.com/mudcube/MIDI.js)\n\n-   A very similar parser but for Node.js only [MIDI Converter](https://github.com/mobyvb/midi-converter)\n\n-   A parser for converting MIDI into a JavaScript object which can also turn it back into a binary MIDI file again: [MIDIFile](https://github.com/nfroidure/MIDIFile)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisguttandin%2Fmidi-json-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisguttandin%2Fmidi-json-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisguttandin%2Fmidi-json-parser/lists"}