Unexpected MIDI output over USB

I'm trying to make an Arduino Mega 2560 send out MIDI messages over USB as part of a sound based physical computing project. Most of the tutorials online assume that I'm using a MIDI DIN connection when I'm actually trying to use the USB port on the Arduino via a MIDI/ serial bridge program (Hairless MIDI Serial), is this just needlessly complicating matters? If so I'll get the required parts to bypass the USB port tomorrow, though I'd rather not.

I'm using the included MIDI example sketch (as also seen here) which should simply output the notes between F#0 and F#5 yet the MIDI/ serial bridge program gives me many messages such as "Warning: got a status byte when we were expecting 1 or more data bytes, sending possibly incomplete MIDI message 0xc0".

Could anyone tell me why this is happening? I'm using the IAC bus to send the MIDI to Ableton Live or Logic and both programs recognise some MIDI activity from the Arduino in the form of program change numbers rather than note on messages.

My Mac has been a bit weird lately, freezing for a second or two when a USB device is attached so perhaps that's the problem? I'm going to do an erase and install of OSX tomorrow but I was hoping that someone would tell me that it's not my mac's fault. I am currently running Mountain Lion (10.8.2) by the way.

Thank you.

I have a similar problem using the Hairless MIDI Serial.

I set the MIDI Out to MIDI Yoke.

In fact, the Hairless MIDI Serial is doing some work with the bits it gets from Arduino serial, and Ableton is receiving some data from MIDI Yoke, but not the data I expect.

There are many optiones in the Hairless MIDI Serial->File->Preferences, I am trying first to change the baud rate, but without success.

Do you have any news?

Thanks.

Does your setup look like this?(you should post your code anyways):

void setup() {
  MIDI.begin();
  Serial.begin(115200);
}

Hi there!

I'm having the exact same issue, have you got any answer to the problem?
I tried a lot different lines of codes, with and without libraries, however the none of them have worked for me.

Thanks,

This works for me:-

/* Midi note fire - Mike Cook
 *
 * send MIDI serial data, automatically for a test
 * 
*/
#define midiChannel (char)0

void setup() {
 //  Setup serial
  // Serial.begin(31250);  // MIDI speed
  Serial.begin(115200);  // Hairless speed
}

void loop() {
  int val;
  for(int ins=0; ins<127; ins++){ // one note from all the instruments
  voiceChange(ins); 
  val = random(20,100);
    noteSend(0x90, val, 127); // note on
    delay(200);
    noteSend(0x80, val, 127); // note off
   delay(800);
    } // end loop function
}

// sends voice change message
  void voiceChange(int i){
     Serial.write(0xC0); // program change message
     Serial.write(i); 
  }
//  plays a MIDI note
 void noteSend(char cmd, char data1, char data2) {
  cmd = cmd | char(midiChannel);  // merge channel number
  Serial.write(cmd);
  Serial.write(data1);
  Serial.write(data2);
}

It sends random MIDI notes.