finds.dev

rakyll/portmidi

Go bindings for libportmidi

View on GitHub

★ 290GoApache-2.0updated Mar 2022

// the take

Go bindings for PortMidi, giving you basic MIDI I/O: enumerate devices, write note events to an output stream, and read events from an input stream via polling or a channel. It's for anyone building a small MIDI tool or synth controller in Go who doesn't want to write cgo against libportmidi themselves.

The API surface is thin and maps almost 1:1 onto PortMidi's C functions, so if you already know PortMidi there's nothing new to learn. Channel masking is exposed directly (SetChannelMask), which most beginner MIDI wrappers skip. The Listen() channel-based read is a nice ergonomic addition over the raw polling Read() call, useful for event-loop style consumers.

No commits since March 2022 and only 290 stars/54 forks — this is effectively unmaintained, so don't expect fixes for newer Go versions or libportmidi ABI changes. It's a cgo wrapper requiring libportmidi v217 specifically installed system-side, which breaks CGO_ENABLED=0 builds, cross-compilation, and Docker multi-stage images without extra apt-get/brew steps baked in. Error handling on the read path just returns a Go error with no distinction between device disconnects, buffer overruns, or malformed data, so recovery logic has to guess. There's a single example_test.go and no real unit tests, so behavior around edge cases like a MIDI device unplugged mid-stream is undocumented and untested.

We read the README, the directory tree and a key source file in September 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
290
Forks
54
Language
Go
License
Apache-2.0
Last commit
20 Mar 2022

// nearby

If portmidi isn't quite it.

All repos →