{"id":13768042,"url":"https://github.com/dinchak/node-easymidi","last_synced_at":"2026-01-11T10:04:48.369Z","repository":{"id":27361231,"uuid":"30836610","full_name":"dinchak/node-easymidi","owner":"dinchak","description":"Simple event-based MIDI messaging for node.js","archived":false,"fork":false,"pushed_at":"2024-06-16T22:33:49.000Z","size":101,"stargazers_count":193,"open_issues_count":3,"forks_count":33,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-11T03:47:25.209Z","etag":null,"topics":[],"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/dinchak.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-02-15T18:17:45.000Z","updated_at":"2025-01-14T16:20:02.000Z","dependencies_parsed_at":"2023-10-16T11:39:44.501Z","dependency_job_id":"27d69473-7000-483c-a435-fa18c1f491cf","html_url":"https://github.com/dinchak/node-easymidi","commit_stats":{"total_commits":52,"total_committers":15,"mean_commits":3.466666666666667,"dds":0.5,"last_synced_commit":"53da92a9e94b979f987321b9bd6dd0b671af1c7a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinchak%2Fnode-easymidi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinchak%2Fnode-easymidi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinchak%2Fnode-easymidi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinchak%2Fnode-easymidi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dinchak","download_url":"https://codeload.github.com/dinchak/node-easymidi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253497296,"owners_count":21917683,"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":[],"created_at":"2024-08-03T16:01:15.804Z","updated_at":"2026-01-11T10:04:43.329Z","avatar_url":"https://github.com/dinchak.png","language":"JavaScript","readme":"# node-easymidi\nnode-easymidi is a simple event-based MIDI messaging wrapper for [node-midi](https://github.com/justinlatimer/node-midi).\n\n# Installation\nInstall with NPM:\n\n```\nnpm install easymidi\n```\n\n# Usage Overview\nThe module can interface with existing MIDI inputs/outputs or create virtual inputs/outputs.  Here's a simple example to listen for note on events from an existing MIDI input:\n\n```javascript\nconst easymidi = require('easymidi');\nconst input = new easymidi.Input('MIDI Input Name');\ninput.on('noteon', function (msg) {\n  // do something with msg\n});\n```\n\nHere's an example of sending a note on message to an existing MIDI output:\n\n```javascript\nconst easymidi = require('easymidi');\nconst output = new easymidi.Output('MIDI Output Name');\noutput.send('noteon', {\n  note: 64,\n  velocity: 127,\n  channel: 3\n});\n```\n\nThe Input and Output objects are [EventEmitters](http://nodejs.org/api/events.html#events_class_events_eventemitter) and you can use the EventEmitter functions such as `once()`, `removeListener()`, and `removeAllListeners()` as well.\n\n# Virtual Devices\nVirtual devices can be created by passing a `true` argument to the Input or Output constructors:\n\n```javascript\nconst virtualInput = new easymidi.Input('Virtual input name', true);\nconst virtualOutput = new easymidi.Output('Virtual output name', true);\n```\n\n# Device Lists\nYou can get an array of existing MIDI input or output names using the `getInputs()` and `getOutputs` functions:\n\n```javascript\nconst inputs = easymidi.getInputs();\nconst outputs = easymidi.getOutputs();\n```\n\n# Closing Devices\nWhen you're finished with a MIDI device you can `close()` it:\n\n```javascript\nconst input = new easymidi.Input('My input', true);\ninput.close();\n\nconst output = new easymidi.Output('My output', true);\noutput.close();\n```\n\n# Message Reference\nThe following table describes the MIDI message types that are supported and the parameters of each:\n\n| Type               | Parameter          | Parameter        | Parameter      |\n|--------------------|--------------------|------------------|----------------|\n| noteon             | note [0-127]       | velocity [0-127] | channel [0-15] |\n| noteoff            | note [0-127]       | velocity [0-127] | channel [0-15] |\n| poly aftertouch    | note [0-127]       | velocity [0-127] | channel [0-15] |\n| cc                 | controller [0-127] | value [0-127]    | channel [0-15] |\n| program            | number [0-127]     |                  | channel [0-15] |\n| channel aftertouch | pressure [0-127]   |                  | channel [0-15] |\n| pitch              | value [0-16384]    |                  | channel [0-15] |\n| position           | value [0-16384]    |                  |                |\n| mtc                | type [0-7]         | value [0-15]     |                |\n| select             | song [0-127]       |                  |                |\n| clock              |                    |                  |                |\n| start              |                    |                  |                |\n| continue           |                    |                  |                |\n| stop               |                    |                  |                |\n| activesense        |                    |                  |                |\n| reset              |                    |                  |                |\n| sysex              | bytes (variable length array) |             |                | \n\n# Examples\n\nReceive a noteon message:\n\n```javascript\ninput.on('noteon', function (params) {\n  // params = {note: ..., velocity: ..., channel: ...}\n});\n```\n\nSend a control change message:\n\n```javascript\noutput.send('cc', {\n  controller: 37,\n  value: 80,\n  channel: 0\n})\n```\n\nListen for midi clock messages:\n\n```javascript\ninput.on('clock', function () {\n  // do something on every clock tick\n});\n```\n\nSend a sysex message.  \nThrows an error if array does not start with 0xf0 (240) and end with 0xf7 (247).\n```javascript\noutput.send('sysex',[240, 126, 1, 6, 1, 247]);\n```\n\nSee the [example programs](https://github.com/dinchak/node-easymidi/tree/master/examples) for more examples.\n","funding_links":[],"categories":["Libraries: Web MIDI API","JavaScript"],"sub_categories":["Web MIDI API"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinchak%2Fnode-easymidi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdinchak%2Fnode-easymidi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinchak%2Fnode-easymidi/lists"}