Go Down

Topic: Can't send MIDI notes through Hariless Serial - MIDI Bridge (Read 206 times) previous topic - next topic

Zsombro

Dear everyone,

I'm trying to send MIDI notes to a DAW using Arduino through the USB port using the Hairless MIDI Bridge and loopMidi. I wrote a simple sketch based on what I've found on the internet, set the Baud rate to what was setup in Hairless, loaded the code, but only got a bunch of "Unexpected byte data" messages in the Hairless debugger. I'm using an Arduino Mega 2560.

Code: [Select]

+0.727 - Error: got unexpected data byte 0x53.
+0.727 - Error: got unexpected data byte 0x65.
+0.727 - Error: got unexpected data byte 0x6e.
etc. etc.


I wrote the following code in Arduino. It's supposed to send a F# note through the serial port that lasts 500 ms

Code: [Select]

#define LED 13           // LED pin on Arduino Uno

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

void midi(byte c, byte p, byte v)
{
  Serial.write(c);
  Serial.write(p);
  Serial.write(v);
}

void loop()
{
  digitalWrite(LED, HIGH);
  midi(0x90, 90, 127);
  delay(500);
  midi(0x90, 90, 0);
  digitalWrite(LED, LOW);
}


An interesting thing I noticed is that when I check the serial monitor in the Arduino IDE, I get a leftover message from a previous sketch I used (that just keeps sending the string "Sending!!!!"), even though I loaded several different programs onto the controller since then.

What could be the problem? Thank you in advance

Zsombro

I'm an idiot.

The Arduino IDE was set to a different board that I used a few days before. That's why nothing happened. I changed it back to Mega 2560 and it works flawlessly.

Sorry if this bothered anyone.

Go Up