Getting ProMIDI to work in Processing on OS X Leopard
There is a commonly used MIDI library for Processing called ProMIDI. They don’t seem to document this on their site (their documentation is terrible in general), but it will not work out-of-the-box on Leopard, due to Apple not supporting a certain Java MIDI class after 10.4.8. Luckily some folks stepped in and made MMJ, a Java MIDI subsystem. Read on for all the details.
From their site:
As of Mac OS X version 10.4.8 Apple do no longer support the com.apple.audio.midi java package, which on previous OS X versions allowed java applications to easily access the CoreMIDI system. mmj steps into that hole by providing a universal binary JNI wrapper to CoreMIDI, that is deployable accross system versions and processor architectures. If you need to work with Midi from java on both PowerPC and Intel Macs with all Java runtimes >= 1.4, this is what you need.
Here’s what you do:
- Download the library here.
- Look for
/Library/Java/Extensionson your harddisk. If the path doesn’t exist, go ahead and make it.
mmj.jarfrom the zip file to that extensions path.
- If you want to send or receive MIDI from within your computer, you’ll need a software bus. On OS X Leopard (not sure if this is on previous versions?), this is REALLY easy, and instructions follow. On Windows I think you have to use MidiOx/Yoke or something similar.
- Open the Audio/MIDI Setup program in /Applications/Utilities.
- Double click on the red IAC Driver button.
- Check “Device is online.”
- Click “Apply” if possible, on mine it is grayed out but it doesn’t seem to matter.
- Now when you run your
midiIO.printDevices();command you will see:
input 0 : IAC Driver - Bus 1
output 0 : IAC Driver - Bus 1
…or whatever you named the bus (that is the default), and usually the “Java Sound Synthesizer” as well. Bingo! Now you just set your other program (like Ableton Live, etc.) to use that same bus and you can start to send MIDI back and forth. Enjoy!