Pages: [1]   Go Down
Author Topic: Need help MIDI Out from Arduino  (Read 1436 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi guys

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

http://www.roguescience.org/wordpress/wp-content/uploads/2011/07/midiO.png

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:
void ProcessMIDIOut(byte cmdtype, byte val1, byte val2)
{
  
 //bugging test purposes: to see what values the TX pin is sending out.
  SSerial.print("?x00?y2");
  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:
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



Logged

France
Offline Offline
Sr. Member
****
Karma: 2
Posts: 380
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
http://www.sparkfun.com/datasheets/DevTools/Arduino/MIDI_Shield-v13.pdf
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

France
Offline Offline
Sr. Member
****
Karma: 2
Posts: 380
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Thank you so much!!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

France
Offline Offline
Sr. Member
****
Karma: 2
Posts: 380
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

http://www.midi.org/techspecs/midimessages.php

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

Hope it cans help you.



Logged

Offline Offline
Edison Member
*
Karma: 35
Posts: 1429
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.

Pete
Logged

Where are the Nick Gammons of yesteryear?

Pages: [1]   Go Up
Jump to: