{"id":13433629,"url":"https://github.com/colxi/midi-parser-js","last_synced_at":"2026-01-23T05:42:59.781Z","repository":{"id":11252387,"uuid":"68847591","full_name":"colxi/midi-parser-js","owner":"colxi","description":"JSON Human readable MIDI sequences. Read from ArrayBuffers, Base64 encoded strings, or FileInput Element in Browsers.","archived":false,"fork":false,"pushed_at":"2023-08-12T11:28:44.000Z","size":604,"stargazers_count":237,"open_issues_count":13,"forks_count":31,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-07-23T13:54:10.650Z","etag":null,"topics":["javascript","midi","midi-javascript","midi-js","midi-parser","midi-parser-js"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/colxi.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":"2016-09-21T18:46:43.000Z","updated_at":"2025-07-01T13:20:18.000Z","dependencies_parsed_at":"2024-06-18T17:13:02.376Z","dependency_job_id":null,"html_url":"https://github.com/colxi/midi-parser-js","commit_stats":{"total_commits":62,"total_committers":5,"mean_commits":12.4,"dds":0.09677419354838712,"last_synced_commit":"310b0769399f53a209880280d8b27236175dfe17"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/colxi/midi-parser-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colxi%2Fmidi-parser-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colxi%2Fmidi-parser-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colxi%2Fmidi-parser-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colxi%2Fmidi-parser-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/colxi","download_url":"https://codeload.github.com/colxi/midi-parser-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colxi%2Fmidi-parser-js/sbom","scorecard":{"id":300509,"data":{"date":"2025-08-11","repo":{"name":"github.com/colxi/midi-parser-js","commit":"310b0769399f53a209880280d8b27236175dfe17"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":1,"reason":"Found 3/26 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T20:29:29.328Z","repository_id":11252387,"created_at":"2025-08-17T20:29:29.329Z","updated_at":"2025-08-17T20:29:29.329Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28681163,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T04:33:33.518Z","status":"ssl_error","status_checked_at":"2026-01-23T04:33:30.433Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["javascript","midi","midi-javascript","midi-js","midi-parser","midi-parser-js"],"created_at":"2024-07-31T02:01:31.301Z","updated_at":"2026-01-23T05:42:59.765Z","avatar_url":"https://github.com/colxi.png","language":"JavaScript","readme":"![logo](https://colxi.info/midi-parser-js/docs/logo.png)\n\n# MidiParser.js \n[![NoDependencies](https://img.shields.io/badge/dependencies-none-green.svg)](https://github.com/colxi/midi-parser-js)\n[![Browser](https://img.shields.io/badge/browser-compatible-blue.svg)](https://github.com/colxi/midi-parser-js)\n[![Node](https://img.shields.io/badge/node-compatible-brightgreen.svg)](https://www.npmjs.com/package/midi-parser-js)\n\nMidiParser is a Javascript **Binary MIDI file** reader for the browser and Node which converts a MIDI binary data structure to **a JSON object**, making it much easier to iterate over and interact with.\n\n- Tiny and dependency free\n- Browser \u0026 Node Compatible\n- Supported data input : \n  -  ```BASE64``` encoded Midi data\n  - ```UINT8``` arrayBuffer, obtained when reading or fetching a   .mid binary. \n  - ```FileInput Element``` in the Browser \n- Custom Midi Messages\n\n\n\n## Example\n\nA simple example parsing a MIDI file in Node ...\n```javascript\nlet midiParser  = require('midi-parser-js');\nlet fs = require('fs')\n\n// read a .mid binary (as base64)\nfs.readFile('./test.mid', 'base64', function (err,data) {\n  // Parse the obtainer base64 string ...\n  var midiArray = midiParser.parse(data);\n  // done!\n  console.log(midiArray);\n});\n```\n\nExample in Browser...\n```html\n\u003cscript type=\"module\"\u003e\n  import MidiParser from 'midi-parser-js'\n  // select the INPUT element that will handle\n  // the file selection.\n  let source = document.getElementById('filereader');\n  // provide the File source and a callback function\n  MidiParser.parse( source, function(obj){\n    console.log(obj);\n  });\n\u003c/script\u003e\n\u003cinput type=\"file\" id=\"filereader\"/\u003e\n```\nIf you want to see it in action, you can test it [Here](https://colxi.info/midi-parser-js/test/test-es6-import.html)\n\n## Syntax:\n\n\n```javascript\n  MidiParser.parse( input [, callback] );\n```\n**- input** : Accepts any of the supported Data Sources : `FileInputElement  | uint8Array | base64String`\n\n**- callback** : Callback to be executed when data is parsed. Only required when input is a `FileInputElement`. \n \n\n\n---\n\n## Handle Custom messages ( sysEx, non-standard...)\n\nBy default, the library ignores the sysEx, and non-standard messages, simply converting their values to integers (when possible).\nHowever you can provide a custom hook function to be executed when any non-standard message is found, and process it by your own, returning the resulting value.\n\n\n```javascript \nMidiParser.customInterpreter = function( msgType, arrayBuffer, metaEventLength){  /* your code */ }\n```\n\n**- msgType** : Hex value of the message type\n \n**- arrayBuffer** : Dataview of the midi data. You have to extract your value/s from it, moving the pointer as needed.\n\n**- metaEventLength** : A length greater than 0 indicates a received message\n\n\u003e If you want the default action to be executed, return **false**\n\n\n## Output JSON anatomy  :\n\nThe returned JSON object contains all the attributes of the MIDI file (format type, time division, track count... ) as properties. The tracks and the MIDI events related to each track are container inside the `track` property. \n\n![logo](https://colxi.info/midi-parser-js/docs/diagram.jpg)\n\n\nThe following JSON object represents a MIDI file with **3 tracks** and **4 events** in **Track 0**\n\n```javascript\noutputObject{\n....formatType: 0|1|2,  // Midi format type\n....timeDivision: (int),  // song tempo (bpm)\n....tracks: (int),  // total tracks count\n....track: Array[\n........[0]: Object{  // TRACK 1!\n............event: Array[  // Midi events in track 1\n................[0] : Object{  // EVENT 1\n....................data: (string),\n....................deltaTime: (int),\n....................metaType: (int),\n....................type: (int)\n................},\n................[1] : Object{...},  // EVENT 2\n................[2] : Object{...}, // EVENT 3\n................[3] : Object{...}  // EVENT 4\n............]\n........},\n........[1] : Object{...},  // TRACK 2\n........[2] : Object{...}  // TRACK 3\n....]\n}\n```\nIf you want to read the data from **Event 2** of **Track 0** , you should use the following keypath :\n\n```javascript\noutputObject.track[0].event[2].data;\n```\n---\n \n## Distribution \u0026 Installation :\n\nThe following distribution channels are available :\n\n\n**- NPM** : Install using the following command :\n\n```bash\n  $ npm install midi-parser-js -s\n```\n\n**- GIT** : You can clone the repository  :\n```bash\n  $ git clone https://github.com/colxi/midi-parser-js.git\n```\n\n**-ZIP** : Or download the package in a ZIP file from\n\u003e [GITHUB LATEST PACKAGE RELEASE PAGE](https://github.com/colxi/midi-parser-js/releases/latest)\n\n\n**-CDN** : Include the latest release of this library in your HTML head using the CDN :\n\u003e Warning : Not recommended for production enviroments!\n\n```html\n\u003cscript src=\"https://colxi.info/midi-parser-js/src/main.js\"\u003e\u003c/script\u003e\n```\n## Importing\nThis package is shipped with support to Node CommonJS and ES6 Modules. Use the appropiate method accoordintg to your enviroment.\n\n```javascript\n  // ES6 Module Import : \n  import {MidiParser} from './midi-parser.js'; \n\n  // CommonJS Node Import :\n  let MidiParser = require('midi-parser-js');\n```\n\n--- \n## Bonus : MIDI File Format Specifications :\n\nMIDI Binary Encoding Specifications in https://github.com/colxi/midi-parser-js/wiki/MIDI-File-Format-Specifications\n\n","funding_links":[],"categories":["JavaScript","Libraries: Web MIDI API"],"sub_categories":["Web MIDI API"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolxi%2Fmidi-parser-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolxi%2Fmidi-parser-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolxi%2Fmidi-parser-js/lists"}