DIY MIDI Interface for iPad

My latest hardware project is a USB MIDI interface using a Teensy 2.0 and Arduino.

Teensy 2.0 based MIDI interface

I want to use this with my iPad, so there are some special requirements. It has to be compatible with an iPad, and it has to be compatible with the Lemur app doing bidirectional sysex communication with an AxeFX.

The first requirement was easy to meet. The iPad will recognize a standard midi interface if it reports maxpower of 20mA or less. One line of code in the Teensy usbMIDI library needs to be changed:

In file: \arduino-1.0\hardware\teensy\cores\usb_midi\usb.c
Find:    bMaxPower
On this line, change the 50 to 20. Save the file.
Restart Arduino.

Meeting the second requirement has been more difficult. I’ve tried two ways of handling the incoming sysex messages (from an AxeFX):

  1. Pass the sysex message bytes via USB to the iPad with minimal buffering, only as required to encode the sysex data into USB messages. Lemur receives the sysex message at whatever rate the external device is sending MIDI … about 3 bytes per millisecond.
  2. Store the sysex message in a fifo buffer, and once the complete sysex message is in the buffer, send it to the iPad as quickly as possible. Lemur receives the entire message in a millisecond or two.

There is a problem with method #1. Lemur appears to chop off the tail end of a sysex message if the message takes more than a certain amount of time (one Lemur frame?) to be received.

Method #2 seems to work perfectly with Lemur, but has a limitation that the sysex message cannot be larger than free RAM in the Teensy microcontroller.

If there is interest I will post a schematic and the source code.


One response to “DIY MIDI Interface for iPad

  • tom karches

    I’m interested in the schematic and code to build a generic USB MIDI to serial MIDI bridge. I have a Fluxamasynth shield board that I don’t want to waste a full blown Arduino on (I was planning to implement MOCO on LUFA…still may anyway). This would also be excellent for adding USB MIDI capabilities to old gear OR for letting me use my LPK25 keyboard to drive MIDI devices that don’t have USB MIDI.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: