{"id":17041679,"url":"https://github.com/xlab/portmidi","last_synced_at":"2025-04-12T14:33:16.697Z","repository":{"id":57486642,"uuid":"67873420","full_name":"xlab/portmidi","owner":"xlab","description":"The package provides Go bindings for PortMIDI from the PortMedia set of libraries.","archived":false,"fork":false,"pushed_at":"2017-09-05T16:52:54.000Z","size":31,"stargazers_count":27,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-26T09:11:08.842Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/xlab.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}},"created_at":"2016-09-10T13:46:08.000Z","updated_at":"2024-11-09T09:09:04.000Z","dependencies_parsed_at":"2022-09-01T20:30:48.969Z","dependency_job_id":null,"html_url":"https://github.com/xlab/portmidi","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/xlab%2Fportmidi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xlab%2Fportmidi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xlab%2Fportmidi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xlab%2Fportmidi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xlab","download_url":"https://codeload.github.com/xlab/portmidi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248581361,"owners_count":21128155,"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-10-14T09:13:12.217Z","updated_at":"2025-04-12T14:33:16.679Z","avatar_url":"https://github.com/xlab.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"portmidi [![GoDoc](https://godoc.org/github.com/xlab/portmidi?status.svg)](https://godoc.org/github.com/xlab/portmidi)\n========\n\nPackage portmidi provides Go bindings for [PortMIDI](http://portmedia.sourceforge.net/portmidi/) from the PortMedia set of libraries. [PortMedia](http://portaudio.com) offers free, cross-platform, open-source I/O libraries for digital media including MIDI, video, and audio.\n\nAll the binding code for the `pm` package has automatically been generated with rules defined in [pm.yml](/pm.yml). The wrapping package `portmidi` has been done by hand and leverages channels for MIDI event streaming.\n\n## Usage\n\n```\n$ brew install portmidi\n(or use your package manager)\n\n$ go get github.com/xlab/portmidi\n```\n\n## Examples\n\n### MIDIPipe\n\n[midipipe](/example/midipipe) is a simple Go program that redirects all the events it gets from a MIDI input device\nto the specified MIDI output device. You can specify route by device name (see example) or by its ID.\n\nThe app requires minimum two devices to operate properly, but note that a single hardware piece can act\nboth as input and output device, so by \"devices\" I mean logical I/O streams.\n\n```\n$ brew install portmidi\n$ go get github.com/xlab/portmidi/example/midipipe\n\n$ midipipe -in \"Arturia BeatStep\" -out \"OP-1 Midi Device\"\n\nmain.go:35: [INFO] total MIDI devices: 4\nmain.go:50: [INFO] available inputs: map[Arturia BeatStep:1 OP-1 Midi Device:0]\nmain.go:51: [INFO] available outputs: map[OP-1 Midi Device:2 Arturia BeatStep:3]\n\nmain.go:56: [INFO] input device id=1 .\n├── [CoreMIDI]  Interface\n├── [Arturia BeatStep]  Name\n├── [true]  IsInputAvailable\n└── [false]  IsOutputAvailable\nmain.go:65: [INFO] output device id=2 .\n├── [CoreMIDI]  Interface\n├── [OP-1 Midi Device]  Name\n├── [false]  IsInputAvailable\n└── [true]  IsOutputAvailable\n\nmain.go:80: [DBG] rate 1 minute 100.14564014611834\nmain.go:81: [DBG] rate 5 minute 51.93229225191669\nmain.go:82: [DBG] rate mean 134.09919032344553\n\nmain.go:80: [DBG] rate 1 minute 65.02414338183416\nmain.go:81: [DBG] rate 5 minute 51.98104984601001\nmain.go:82: [DBG] rate mean 93.71848260518783\n^Cmain.go:72: bye!\n```\n\n### Vocoder\n\n[vocoder](/example/vocoder) is an implementation of a simple vocoder in Go. It reads your voice using PortAudio, reads note-on events from your MIDI device using PortMIDI, and plays the altered voice back using PortAudio. Have fun.\n\n```\n$ brew install portaudio portmidi\n$ go get github.com/xlab/portmidi/example/vocoder\n\n$ vocoder -in \"Arturia BeatStep\"\nmain.go:43: [INFO] available inputs: map[IAC Driver Bus 1:0 Arturia BeatStep:1]\nmain.go:46: Using Arturia BeatStep (via CoreMIDI)\nmain.go:62: note 63 (311.127Hz)\nmain.go:62: note 62 (293.665Hz)\nmain.go:62: note 65 (349.228Hz)\nmain.go:62: note 73 (554.365Hz)\nmain.go:62: note 66 (369.994Hz)\nmain.go:62: note 60 (261.626Hz)\n^C\n```\n\n### Rebuilding the package\n\nYou will need to get the [cgogen](https://git.io/cgogen) tool installed first.\n\n```\n$ git clone https://github.com/xlab/portmidi \u0026\u0026 cd portmidi\n$ make clean\n$ make\n```\n\n## License\n\nAll the code except when stated otherwise is licensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxlab%2Fportmidi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxlab%2Fportmidi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxlab%2Fportmidi/lists"}