{"id":16899071,"url":"https://github.com/chrisguttandin/json-midi-encoder","last_synced_at":"2025-09-14T02:32:09.890Z","repository":{"id":8871148,"uuid":"60014113","full_name":"chrisguttandin/json-midi-encoder","owner":"chrisguttandin","description":"This module encodes a JSON representation of MIDI data into a binary MIDI file.","archived":false,"fork":false,"pushed_at":"2024-04-27T18:49:10.000Z","size":20522,"stargazers_count":39,"open_issues_count":1,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-01T23:22:17.539Z","etag":null,"topics":["midi"],"latest_commit_sha":null,"homepage":null,"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":"2016-05-30T13:56:04.000Z","updated_at":"2024-05-04T00:32:33.143Z","dependencies_parsed_at":"2024-05-04T00:32:16.466Z","dependency_job_id":"1e1ea09d-7aca-47e9-ae94-4a818ce0542b","html_url":"https://github.com/chrisguttandin/json-midi-encoder","commit_stats":{"total_commits":3736,"total_committers":3,"mean_commits":"1245.3333333333333","dds":0.03827623126338331,"last_synced_commit":"01a4c7255394a85222a78d7d08e12f284f4ad83e"},"previous_names":[],"tags_count":272,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisguttandin%2Fjson-midi-encoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisguttandin%2Fjson-midi-encoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisguttandin%2Fjson-midi-encoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisguttandin%2Fjson-midi-encoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrisguttandin","download_url":"https://codeload.github.com/chrisguttandin/json-midi-encoder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232810792,"owners_count":18579924,"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-10-13T17:47:19.617Z","updated_at":"2025-01-07T22:27:33.079Z","avatar_url":"https://github.com/chrisguttandin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json-midi-encoder\n\n**This module encodes a JSON representation of MIDI data into a binary MIDI file.**\n\n[![version](https://img.shields.io/npm/v/json-midi-encoder.svg?style=flat-square)](https://www.npmjs.com/package/json-midi-encoder)\n\nBy using this module it is possible to encode a JSON representation of a MIDI file into its binary\ncounterpart. That JSON representation can either be created from scratch or produced by parsing an\nexisting file with the [midi-json-parser](https://github.com/chrisguttandin/midi-json-parser).\n\n## Usage\n\nThis module is distributed as package on [npm](https://www.npmjs.com/package/json-midi-encoder). It\ncan be installed by running the following command:\n\n```shell\nnpm install json-midi-encoder\n```\n\nThe only exported function is called `encode()`. It expects to receive a JSON representation as its\nonly parameter. It returns a Promise which hopefully resolves with an ArrayBuffer containing the\nbinary MIDI file. Here is a little example.\n\n```js\nimport { encode } from 'json-midi-encoder';\n\nconst json = {\n    division: 480,\n    format: 1,\n    tracks: [\n        [\n            {\n                delta: 0,\n                trackName: 'example'\n            },\n            // ... there are probably more events ...\n            {\n                delta: 0,\n                endOfTrack: true\n            }\n        ]\n        // ... maybe there are more tracks ...\n    ]\n};\n\nencode(json).then((midiFile) =\u003e {\n    // midiFile is an ArrayBuffer containing the binary data.\n});\n```\n\nTo see what kind of events this module can handle, you may want to have a look at the\n[JSON files](https://github.com/chrisguttandin/json-midi-encoder/tree/master/test/fixtures) used\nto test this module. There is also a\n[TypeScript interface](https://github.com/chrisguttandin/midi-json-parser-worker/blob/master/src/interfaces/midi-file.ts)\nwhich describes the JSON representation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisguttandin%2Fjson-midi-encoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisguttandin%2Fjson-midi-encoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisguttandin%2Fjson-midi-encoder/lists"}