I have programmed an Arduino to output serial MIDI CC messages when I adjust potentiometers connected to it. To control my MIDI capable applications I could just send this data to a MIDI cable and then to a commercial USB-MIDI interface, but that would still require another cord to power the controller. Instead I have written a Max patch that uses the OSX IAC Driver.
This driver is a virtual midi device that you can use to route MIDI to, through and from. My Max patch parses the serial data from the Arduino to the IAC Driver. By choosing the IAC Driver as a MIDI input in Live (or any other MIDI capable app) you can then use the serial MIDI CC data sent from the Arduino to control your software.
The MIDI data that the Max patch expects at the serial input is in the standard MIDI format for a CC message; a status byte, a control number and a value. This simple patch just listens for a status byte of 176 which is a control change on channel 1. The baud rate I chose for this patch was 57600. Note that you do not have to use the standard MIDI data rate of 31250 baud.
To enable the IAC Driver go to Applications->Utilities->Audio MIDI Setup, click on the MIDI Devices tab and then double click the IAC Driver icon make sure that the Device is online check box is checked.
To use this patch you need the MaxMSP Runtime. Once you have that installed open it up and then open the patch with it. Double click on the midiout object and select the IAC Driver. Then click the button at the top of the chain to start reading the serial port and parsing the data. You should now be able to use midi learn to map your controllers and start tweaking stuff in realtime with your potentiometers.
Here is what the patch looks like:
If you own Max just copy the following code and then paste it in a blank patcher.
----------begin_max5_patcher----------
488.3ocuVsrahCCEccxWwUdclQ9QdTlcUpa5h9ETUMxPLTOJwFkXTof5+9X6
.COFjvIjhDgHesu1m64dNIYabDZpdsnEA+BdEhh1FGE4C4BDsabDpludVEu0
uLjR7gd5ePIcSYDqM9vapf4xJinAHE46mUspVppDFelzCA0qLmGctVYT7Zge
ydrQxq1uIK4lYuKUK9ciXloCozT7OwI.kl4tkOwOvFBdaWNcGf4ykhtDPnD6
0+l1cXsxM9IITa1cgkk9S2Vd+ffbg9JN18WxsQMKajJC7xyO87E4ExE4E7P3
ER1I7B6+3kqW3ECovM5EKpD8n5HWs2xv6A+0ZsVx8Pm8nJgMhsvZgoQCY8PW
StAccgu8kQtdsOkqVzGYMcD4jVgqZ.NjUjiwvC.Av8PBbKFeRmtfPxCSdzSy
OaLc+0xRoETe2VeZpWtvRSc2RmL.qOCOxk8bcSM+xUdwnaZnO3cMDbeejQ.t
lIiIw3p.2KIAkx9a.OzbPNl77fYmd8dxrioFehnJo57OovCLW7S4qV8plY6O
1caWBb.ZkhViTwMRs53EcxZdWVVJTG6arRukZaKdGFf2tXyKXHE.hrBDKod2
fDKDLcFU9ciIZ.Phce6brP5b2WRZRHrD99puCwxUbCPxN3q3+JxEVKJ
-----------end_max5_patcher-----------
If you don’t own Max then you can download the patch here.
I will try and put together a more complete patch with user selectable options sometime soon.



Good post.
Thanks.