{"id":13768682,"url":"https://github.com/Pomax/midi-with-node","last_synced_at":"2025-05-10T23:31:40.036Z","repository":{"id":66063797,"uuid":"70412046","full_name":"Pomax/midi-with-node","owner":"Pomax","description":"Turn your browser into a MIDI device through the magic of Nodejs, easymidi, and socket.io","archived":false,"fork":false,"pushed_at":"2018-03-25T05:23:21.000Z","size":194,"stargazers_count":31,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"gh-pages","last_synced_at":"2025-04-13T07:14:43.649Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Pomax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-10-09T15:26:13.000Z","updated_at":"2025-02-13T01:51:39.000Z","dependencies_parsed_at":"2023-02-21T00:16:46.478Z","dependency_job_id":null,"html_url":"https://github.com/Pomax/midi-with-node","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pomax%2Fmidi-with-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pomax%2Fmidi-with-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pomax%2Fmidi-with-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pomax%2Fmidi-with-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pomax","download_url":"https://codeload.github.com/Pomax/midi-with-node/tar.gz/refs/heads/gh-pages","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:24.489Z","updated_at":"2025-05-10T23:31:39.419Z","avatar_url":"https://github.com/Pomax.png","language":"JavaScript","readme":"# A simple browser-as-MIDI-keyboard thing\n\nThis code relies on [node.js](http://nodejs.org) with [easymidi](https://www.npmjs.com/package/easymidi) to set up a virtual MIDI device, [express](http://expressjs.com/) for acting as a simple server, and [socket.io](http://socket.io/) to let a browser communicate keyup/keydown to the node server so that it can generate the corresponding MIDI events.\n\nThe MIDI devide will show up as \"Nodejs MIDI out\" in any DAW (digital audio workstation) with MIDI device capabilities (for instance, [Reaper](http://www.reaper.fm) or [FL Studio](https://www.image-line.com/flstudio)), so simply select and/or enable it in the list of MIDI inut devices, and start typing in the browser with your keyboard. Load up a virtual instrument for infinite fun (I'm currently messing around with [Eighty Eight Ensemble](http://sonivoxmi.com/products/details/eighty-eight-ensemble-2) by [SONiVOX](http://sonivoxmi.com), which is a 9' steinway piano).\n\nThe following keyboard bindings are supported in the browser when focus is on the general document:\n\n```\n 2 3   5 6 7   9 0\nq w e r t y u i o p\n| | | | | | | | | |\nC D E F G A B C D E\n\n s d   g h j\nz x c v b n m\n| | | | | | |\nC D E F G A B\n```\n\nAdditionally, you can use your left/right arrow keys to shift the input by entire octaves.\n\nTo create patterns in the arpeggiator, click a field and then use your keyboard to type the key you want. The arpeggiator will then show the MIDI number for that key based on which octave-set you were in when you typed the key. To clear a field, select it and then press OK with an empty string.\n\nBeats Per Minute is controlled with the BPM number input, as is the swing ratio, for which 0.0 is a straight 4:4 beat, 0.2 is a standard 12:8 jazz swing, 0.5 is \"My baby just cares for me\" levels of swing, and anything above that (capped at 1.0) is probably more swing than you'll ever need.\n\n## How-to-\"this\"\n\nClone and install:\n\n```\n$\u003e git clone https://github.com/Pomax/midi-with-node\n$\u003e cd midi-with-node\n```\n\nThen in order to use things, run the following command:\n\n```\n$\u003e npm start\n```\n\n(If this is the first time you run `npm start`, this will also install the dependencies that the code relies on.)\n\nThis also lets you open [http://localhost:8080](http://localhost:8080) in the browser for generating MIDI events.\n\nThen in your DAW, go to the MIDI device options and find the \"Nodejs MIDI out\" device and either enable it or add it to your list of active MIDI inputs.\n\nAt this point you can do whatever you want in your DAW to set up tracks that are bound to MIDI input, and typing keys in the browser tab for the virtual MIDI device will send MIDI events to your DAW.\n\n## Works out of the box on Linux and OSX, requires one more thing on Windows\n\nThis code works because [easymidi](https://www.npmjs.com/package/easymidi) relies on the [midi](https://www.npmjs.com/package/midi) package, which in turn relies on ALSA to create a virtual midi device. That... does not work on Windows, because it uses a completely different audio stack.\n\nTo make things work on Windows, you need a MIDI loopback device like [loopmidi](http://www.tobias-erichsen.de/software/loopmidi.html) or [loopbe1](http://nerds.de/en/loopbe1.html) installed. With (either of) those running, create a virtual MIDI device called `NodeJS MIDI out` (technically case insensitive) before running `npm start` and you should be good to go. Easymidi will see the device acting as MIDI I/O based on the name and select that on the `win32` platform (even when you're on x64, because Node uses `win32` as Windows indicator in the same way it uses `darwin` for OSX despite that being a truly ancient OSX at this point).\n\n## Live demo\n\nNot technically live because it needs a Node.js backing, but the web UI can be viewed over on https://pomax.github.io/midi-with-node/public\n\n## Screenshots\n\n![a screenshot of the browser MIDI panel](screenshot.png)\n","funding_links":[],"categories":["MIDI instruments"],"sub_categories":["Piano"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPomax%2Fmidi-with-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPomax%2Fmidi-with-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPomax%2Fmidi-with-node/lists"}