Skip to content


Subversion checkout URL

You can clone with
Download ZIP
A simple wrapper using ffi around the portmidi library. This is hopefully easier to build than the c extension I did earlier
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples write support, sysex parsing, examples
lib changed readme, added changelog, bumped version
CHANGELOG changed readme, added changelog, bumped version
README.rdoc flushing Cannoli



This is a small, incomplete wrapper around the portmidi c library.

It is the successor of my portmidi-ruby project which used ordinary ruby extensions which are a pain to write.


  • portmidi (who woulda thought) built as a dynamic library. See below for special notes for Mac OS X Snow Leopard

  • ffi (which in turn needs a sane build env to be installed)

What's missing?

The most important: Tests. I'm still pondering on how to test a library that has hardware requirements and dependencies (= MIDI hardware). So I guess it means I will mock away the portmidi layer to test my abstractions and add some optional integration test that will require a MIDI loopback configuration.

Implementation wise, there's a few things missing:

  • Setting Channel- and Message filters

  • Porttime support(not sure I can support that, I guess it needs multithreading, plus: I did not need it until now)

examples/read_test.rb on how to decipher sysex atm.

  • More different exceptions, plus support for Host Errors

  • A lot of safety nets like testing for open devices before reading and writing and such.


The portmidi wrapper was thrown together by Jan Krutisch <>

Installing Portmidi

  • On MacOSX, there's a homebrew recipe, so $ brew install portmidi should do the trick

  • On most Linuxes, portmidi should be simply a package to install by your packagemanager

  • On Windows? Frankly, I'm one of those arrogant anti Windows guys who could care less. If you're not annoyed by that, “here's a pointer”

Something went wrong with that request. Please try again.