Go Down

Topic: Need help MIDI Out from Arduino (Read 4112 times) previous topic - next topic


Hi guys

so my schematic is pretty simple for the MIDI Out; basically it's the standard setup as shown here:


In fact, when I plug in to the M-audio UNO MIDI interface, I do indeed receive the incoming MIDI data from the arduino (the MIDI IN LED lights up when I change values from the arduino).

However, when I try to hook it up with Reaper in my computer, it's not communicating at all. I've checked that the MIDI interface is not the case because it worked when I hooked it up with a MIDI controller keyboard. However, I did noticed that when I hooked it up with the keyboard, the MIDI IN LED kept turning on and off continuesly, where as with the arduino, it only lights up when I change a MIDI note number.

I did not used the MIDI library that the arduino has. Instead, I've modified from another source. Basically this is what is sending out from the Arduino:

Code: [Select]
void ProcessMIDIOut(byte cmdtype, byte val1, byte val2)
//bugging test purposes: to see what values the TX pin is sending out.
 if (cmdtype == PITCHBEND)
   Serial.print(0xE0 | (channel & 0xf));            //  control change command ***Error here:: "As of Arduino 1.0 the "BYTE" keyword is no longer supported. Please use Serial.write () instead
   Serial.print(val1 & 0x7f);                       //  pb MSB 0-127
   Serial.print(val2);                              //  pb LSB 0-15 - TODO
 else // All standard note and cc messages
   Serial.print(cmdtype | (output_channel & 0xf));  //  control change command
   Serial.print(val1);                           //  command
   Serial.print(val2 & 0x7f);                       //  val1 0-127

So for instance, when I call out the function:

Code: [Select]
ProcessMIDIOut(144, 86, 100)

Would that be enough to communicate with the computer?

I know that these are the values that are sending since I've hooked an LCD to display it


Please all of your sketch.

Did you use : Serial.begin(31250); in the setup part ?

It's better to use midi with diode and an optocoupler to protect arduino from other equipment like the midi in from this schematic.


I've taken consideration on the MIDI IN as you suggessted. Right now, I'm focused on the MIDI OUT

Yes, I set the baud rate 31250

here's the code: https://docs.google.com/document/d/1VpcNgb8phVN_fRRYdFNwo6l-9kQLV7_ToV_rvBiVrQU/edit


ok !

Try to change of the midi send command that are actually Serial.print(...) with Serial.write(...)

Come back to tell us if it changes something.


It worked!!
Yep, that was all it was needed. Just change from print to write.

Thank you so much!!


Allright now I'm difficulties with sending CC messages:

I am sending as so:

ProcessMIDIOut(176,12,xx) where xx-values that can be changed from incoming voltage

is this the right format for sending out CC messages? I want the arduino to act as MIDI controller


look at this table that shows a lot of midi messages.


You will learn that 176 is not an valid CC message...

Hope it cans help you.


You will learn that 176 is not an valid CC message...

176 is the bit pattern 10110000 which is a Control Change on MIDI channel 0.

Don't send me technical questions via Private Message.

Go Up