{"id":15497278,"url":"https://github.com/jwerle/hypermidi","last_synced_at":"2025-10-26T04:03:12.124Z","repository":{"id":148540515,"uuid":"177034681","full_name":"jwerle/hypermidi","owner":"jwerle","description":"Load and play MIDI from Hyperdrive over the DAT network","archived":false,"fork":false,"pushed_at":"2019-03-21T22:55:00.000Z","size":5,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-30T18:02:40.887Z","etag":null,"topics":["dat","hyperdrive","midi","timidity"],"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/jwerle.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":"2019-03-21T22:43:26.000Z","updated_at":"2019-03-21T23:53:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"61004e16-9970-465c-9279-129bc2719005","html_url":"https://github.com/jwerle/hypermidi","commit_stats":{"total_commits":3,"total_committers":2,"mean_commits":1.5,"dds":"0.33333333333333337","last_synced_commit":"40f9a16f0188e7af4b590b2bb78c8985192e929a"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwerle%2Fhypermidi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwerle%2Fhypermidi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwerle%2Fhypermidi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwerle%2Fhypermidi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwerle","download_url":"https://codeload.github.com/jwerle/hypermidi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251747773,"owners_count":21637404,"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":["dat","hyperdrive","midi","timidity"],"created_at":"2024-10-02T08:32:28.059Z","updated_at":"2025-10-26T04:03:12.051Z","avatar_url":"https://github.com/jwerle.png","language":"JavaScript","readme":"hypermidi\n=========\n\nLoad and play MIDI from Hyperdrive over the DAT network using\n[timidity](https://github.com/feross/timidity) and\n[hyperdrive](https://github.com/mafintosh/hyperdrive).\n\n## Installation\n\n```sh\n$ npm install hypermidi\n```\n\n## Usage\n\n```js\nconst midi = require('hypermidi')('/path/to/storage', 'KEY', opts)\n// replicate somehow (discovery-swarm-web works well)\nmidi.play('/path/to/track.mid') // probably need a user gesture/event\n```\n\nThe module expects to load\n[`libtimidity.wasm`](https://github.com/feross/timidity/blob/master/libtimidity.wasm)\nand [freepats sounds sets](https://github.com/feross/freepats) over the network so\nyour web server should be able to serve them.\n\n## Example\n\n```js\nconst hypermidi = require('hyperidi')\nconst Discovery = require('discovery-swarm-web')\nconst ram = require('random-access-memory')\n\nconst key = '4f25776241c2333fa2cb724aac6fcf4d49f6fa7e243238c589cf021728762695'\nconst midi = hypermidi(ram, key)\n\nglobal.midi = midi\nmidi.ready(() =\u003e {\n  const swarm = new Discovery({\n    stream: () =\u003e midi.replicate()\n  })\n\n  swarm.join(midi.discoveryKey)\n\n  const button = document.body.appendChild(document.createElement('button'))\n  button.innerText = 'play'\n  button.onclick = () =\u003e midi.play('Bean.mid', console.log)\n})\n```\n\nRun with [budo]()\n\n```sh\n$ budo example.js --live --port 3000 --dir node_modules/timidity --dir node_modules/freepats\n```\n\nVisit `http://localhost:3000` and press `play`! Assuming you can connect\nto the DAT network and replicate the archive.\n\n## API\n\n### `const midi = require('hypermidi')(storage, key, opts)`\n\nSame arguments as [Hyperdrive](https://github.com/mafintosh/hyperdrive).\n\n#### `midi.play(filename, callback)`\n\nLoad and play a midi file over the network.\n\n#### `midi.pause()`\n\nPause current track.\n\n#### `midi.seek(seconds)`\n\nSeek track to current time in seconds\n\n#### `midi.destroy()`\n\nDestroy the player.\n\n#### `midi.close()`\n\nClose and destroy the player\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwerle%2Fhypermidi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwerle%2Fhypermidi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwerle%2Fhypermidi/lists"}