USB MIDI driver working for UNO. Turn your UNO into a MIDI device.

I've got a USB MIDI device driver working for the UNO's atmega8u2. Just flash it onto the atmega8u2 using dfu-programmer or flip and your UNO becomes a USB MIDI device. I've tested it with GarageBand and it seems to be working well.

Details, firmware hex files, source, and an example sketch are available from

Cheers, Darran.

You are doing great work here. Can I do this with the normal IDE to or do I need special tools (I'm on win 7 )

Do you also intend to implement an USB printer?

That's great news, thank you so much, check my sig for the project I'm working on. :grin:


Wow that's an awesome project! Looks like you're close to having the first PCB-based version up and running. Really impressive.

robtillaart: You are doing great work here. Can I do this with the normal IDE to or do I need special tools (I'm on win 7 )

Do you also intend to implement an USB printer?

You should be able to use flip to load the firmware in windows: You'll need to put the UNO into DFU mode and then use flip. You can put it into DFU mode just by connecting two wires as seen here:,52447.msg374201.html#msg374201; hold wire 1 on the pad, touch wire 2 to the left side of the capacitor for a second or so, remove wire 2, remove wire 1 and the UNO will be in DFU mode ready to upload new firmware. Unplug the USB cable and plug it back in and the UNO will appear as a MIDI device. Note that you can't load sketches when the MIDI firmware is loaded, you have to go through the process again and upload Arduino-usbserial.hex before loading you sketch with the Arduino IDE.

Regarding a USB printer driver, I have a feeling that the firmware would be too large for the 4KB of flash space that's available on the atmega8u2. I'm curious as to what you would do with your Arduino if it could be a printer device?

I've updated the MIDI driver to be bi-directional so now it can also receive MIDI messages from the host. The new firmware, source, and demo sketch is available from Arduino hacking.

What Im doing wrong?

Scenario 1: If I use arduinos MIDI lib , I get “pitchbend” 8/16 - 16/16 as a result in ableton
Scenario 2: if I dont use MIDI lib I get “CC notes” from 1-127 i ableton

(If I have any HEX outside “0xB0 - 0xBF” neither of scenerios works)

#include <usbDevices.h>

#define numPots 6 // numer of pots
#define b 1 // this is the delta needed in

unsigned int currentPot[6] = {0,0,0,0,0,0};
unsigned int pot[6] = {0,0,0,0,0,0};
byte controlChange = 0xBC; //0xB0 or 176

void setup() {
// MIDI.begin();
void loop() {
for(unsigned char i=0; i<numPots; i++) {
currentPot = analogRead(i) / 8; *
if(abs(currentPot_-pot) > b) {
sendMidi(controlChange, i+1, currentPot);_

pot _= currentPot;
void sendMidi(byte controlChange, unsigned int controlNum, int val) {
//MIDI.sendControlChange(controlNum, val);*_

* // Serial.write(unsigned char(controlChange));*
* // Serial.write(unsigned char(controlNum));*
* // Serial.write(unsigned char(val));*
* }*

* [/size]*



Great code!

Well I know it look redic now, I took it from this forum somewere and rewrote it some. regarding all the unsigned ints and stuff i just tested out everything because i cant get it to work. Im pretty new to coding so I really need help :) can you help?