Arduino Forum

Using Arduino => Audio => Topic started by: deseipel on Jan 13, 2013, 04:24 pm

Title: UNO + Olimex Midi Shield (Resolved)
Post by: deseipel on Jan 13, 2013, 04:24 pm
Hi, I'm new and I'd like some advice or help.  I have an Arduino UNO r3 and an Olimex Midi shield.  The function of the box is to receive midi signals via the MIDI IN and then process or handle the notes and trigger events such as program changes, NRPN messages.  And then those messages are sent out MIDI out.  

I do not want to use MIDI over usb, I'm not using a computer for performance.

One of the challenges is that the UNO apparently only has 2 serial channels (TX,RX) and the midi shield, when installed, uses those.  I have to physically remove the shield when I want to upload to the arduino UNO r3.  

The other challenge is that if I wanted to use software serial, I don't think it would work, would it?  Assuming I have my UNO loaded, I reinstall the shield, plug in midi chables, power it on via 9v battery;   softwareserial sends via the 2 digital channels, but those are being 'occupied' by the sheild AND my usb cable isn't connected, so the monitor wouldn't show anything (and COM3 wouldn't be available anyway).  

So can I use software serial AND have the shield on AND have the USB cable connected?  I would say NO.

I'll post my code shortly.
Title: Re: UNO + Olimex Midi Shield
Post by: deseipel on Jan 14, 2013, 07:19 am
Here's the code I'm using (below).  I'm using MIDIOX to send midi messages via a USB to MIDI cable.  The code should do 2 things as a test, 1) turn on the LED when a noteOn is sent and send a noteOn message every second. 

my hardware is a Uno R3 (programmed via USB).  I was able to figure out that the Olimex MIDI shield has a jumper that you can remove to program it, and then replace to run it.  This way I don't have to remove the shield every time. 

There's a lot commented out, because I couldn't even get simple things to work, let alone the rest.

Code: [Select]



#include <MIDI.h>
// set NRPN to set volume to zero for part xyz
// read existing program/patch number ???
// send stop control

int ledPinRed = 06;                 // LED connected to digital pin 6
int ledPinGrn = 07;                 // LED connected to digital pin 7

void HandleNoteOn (byte channel, byte note, byte velocity){
  //int program =0;  //program or patch always begins at 0

    //if note1 or note2 is sent, send program change control to go up or down
  //if (note == 60){   //need to get the actual note number that I'll assign
   // MIDI.sendProgramChange(1,10);
      digitalWrite(ledPinGrn, HIGH);   // sets the LED on
  delay(1000);      // waits for a second;
      digitalWrite(ledPinGrn, LOW);   //set the LED off
  //}
  //if (note == 62){  //need to get the actual note number that I'll assign
   // MIDI.sendProgramChange(2,10);
   //   digitalWrite(ledPinRed, HIGH);   // sets the LED on
  //delay(1000);                  // waits for a second;
    //  digitalWrite(ledPinRed, LOW);  //set the LED off
//  }
}
//if note3 is sent, send nrpn to set volume to zero


void setup() {
pinMode(ledPinRed, OUTPUT);      // sets the digital pin as output
pinMode(ledPinGrn, OUTPUT);      // sets the digital pin as output
   
  //int program =0;  //program or patch hardcoded to begin at zero
  MIDI.begin(MIDI_CHANNEL_OMNI);
  MIDI.setHandleNoteOn(HandleNoteOn);
//  MIDI.sendProgramChange((program),10);   //channel is hard coded to 10 for now
}

void loop () {

  MIDI.read(); //is there incoming MIDI?
 
  // LED Tests
  //digitalWrite(ledPinGrn, HIGH);   // sets the LED on
  //delay(1000);                  // waits for a second
  //digitalWrite(ledPinGrn, LOW);    // sets the LED off
  //delay(1000);                  // waits for a second
MIDI.sendNoteOn(60,127,10);

delay(1000);

MIDI.sendNoteOff(60,127,10);


}




Title: Re: UNO + Olimex Midi Shield
Post by: marco_c on Jan 14, 2013, 08:28 am
You can comment out blocks of code using the /* */ style of comments more easily. You cal also use the IDE to do comment blocks with one menu.

The way your loop is structured there is no delay between the note off and the note on at the start of the loop. You need to add a delay at the bottom of the loop so that you can hear a break in the note.

Do your LEDs come on at all?
Does OMNI work? Try a different channel number?
Have you checked that MIDIOX actually sends out the midi characters?

You also need to get rid of the delays in your code. Delays will stop the rest of the program from working properly. For example, while you delay in loop you are not processing midis messages arriving.


Title: Re: UNO + Olimex Midi Shield
Post by: deseipel on Jan 14, 2013, 04:13 pm
thanks for the quick reply,

I can do an LED test in the loop and they come on, which is encouraging.
Code: [Select]
  /* LED Tests
  digitalWrite(ledPinGrn, HIGH);   // sets the LED on
  delay(1000);                  // waits for a second
  digitalWrite(ledPinGrn, LOW);    // sets the LED off
  delay(1000);                  // waits for a second
  */


  Also, if I didn't mention it, there's a jumper on the Olimex board that allows you to upload without having to remove the whole shield.   

At this point I'm just trying to test 2 things:  if the shield can send and receive MIDI.  So when the device is ON, (powered by  a 9v battery, not the usb, just to be clear), the loop here should send (TX) a noteOn and Off.  (Granted, I need to add a delay for testing purposes, as you mentioned).

Code: [Select]
MIDI.sendNoteOn(60,127,10);

delay(1000);

MIDI.sendNoteOff(60,127,10);



I'm not getting anything in MIDIOX.  The MIDI OUT of the Olimex shield is connected to my laptop via a USB/MIDI converter (Roland UM1).  So, as I understand it (which could be wrong),  the code should send the initial noteOn, jump to the HandleNoteOn, light up the LED, then send noteOff.   ?   I'll try adding a delay after noteOff to see if it helps.

Does OMNI work?  How would I tell?  Its supposed to listen on all channels, so are you saying I should try to listen to a single channel?  I can try that as well. 

MIDIOX has a MIDI In/Out monitor and that's how I'm monitoring the MIDI in/out.  I'm sending MIDI by using the keyboard functionality of MIDIOX.  It shows the midi messages going outbound, but my board doesn't respond.  I've used MIDIOX in the past to send MIDI this way and haven't had any issues. 

Again, thanks for the help. 

Title: Re: UNO + Olimex Midi Shield
Post by: marco_c on Jan 14, 2013, 08:52 pm
On my USB to serial converter, the are a couple of LEDs that tell you if messages are being sent on the out and in lines. Does yours have the same? If so, do you see those LEDs flash at all when you send messages?

I would also suggest that you try to get one direction working at a time. Fix up your sending loop so that you toggle a led on and off with the note on/off that you send. Then verify that you get that message in MIDIOX by monitoring the input window. If you don't work on that first as you are more in control of timing and message.

Then also check the config for MIDIOX. You need to make sure that it is actually using the USB interface for output. The LEDs on the cable would be a good indicator, but you can also check the config to make sure your device paths are set up correctly.

I think OMNI does not work with the midi library. Check the comments on the header file.

An obvious one, but make sure the jumper on the olimex board is replaced after you upload, or you will get nowhere.
Title: Re: UNO + Olimex Midi Shield
Post by: deseipel on Jan 15, 2013, 12:35 am
my USB/MIDI doesn't have lights that light up.

an observation:  right after I upload via USB, I see the UNO TX led light up every second.  I assume this is the MIDI message that I told it to send.  I open up the serial monitor and see garbage coming through each second:

1øÿÿøÿÿ1øÿÿøÿÿ1xÿÿøÿÿ1xÿÿøÿÿ

the baud rate on COM3 is set to 38400bps. 

I tried just having the UNO send MIDI data and I see nothing coming through in MIDIOX.
Title: Re: UNO + Olimex Midi Shield
Post by: deseipel on Jan 15, 2013, 04:07 am
I tried to simply have the UNO send MIDI msgs with LED light up.  The LED lights up, but that's it.  No MIDI sent to MIDIOX.

Here's the schematic to the MIDI shield.  I'm not an electrician, but can someone look at this and give feedback? 

https://www.olimex.com/Products/Duino/Shields/SHIELD-MIDI/resources/SHIELD-MIDI_Rev_A.pdf (https://www.olimex.com/Products/Duino/Shields/SHIELD-MIDI/resources/SHIELD-MIDI_Rev_A.pdf)


I mean, I'm at a loss.  I've tried example after example and tutorials, but I get nothing. No midi In or out.
Title: Re: UNO + Olimex Midi Shield
Post by: marco_c on Jan 15, 2013, 07:28 am
If you see the messages appearing on the serial monitor then they are making it to the PC and I would look at how you have configured MIDIOX. Have you goat a synthesiser or music keyboard the you can connect to the arduino to see if it plays a note? You can also use the same to see if MIDIOX plays the note on the kid.

My bet is on MIDIOX not being configured correctly, though.
Title: Re: UNO + Olimex Midi Shield
Post by: deseipel on Jan 15, 2013, 07:53 am
I've used Midiox and the usb/midi converter cable tons of times, I mean all I usually have to do is make sure the Roland UM1 is selected as input & output.  I can flash the UNO to just send MIDI (to only test TX) and still get nothing in MIDIOX.  LED flashes on the Olimex shield, but as near as I can tell nothing is coming across the wire. 

To clarify, when I said that I saw data in serial monitor, that was when I still had the usb cable from PC->UNO plugged in.  It was not the USB/MIDI cable.  The serial monitor won't work for my tests because the serial is being used by the midi shield.   Any serial communications sent or rxd by the UNO must go through the MIDI shield.  Know what I mean?  :)

That's why this is such a challenge.  I can't monitor the serial communication.  All I have is MIDIOX.  I tried using a USB monitor, but it didn't pick up anything.  I dunno.  It would be great if Olimex would respond.  :)
Title: Re: UNO + Olimex Midi Shield
Post by: marco_c on Jan 15, 2013, 08:06 am
You should be able to find a ttl or terminal program that you can use instead of MIDIOX to verify that you can get data to the PC from the arduino. It may be the Roland thingy is stopping your messages. You should see the same or similar rubbish as the serial monitor. If you google 'terminal program free' you should get a few that will fit the bill.

Once you have established you get messages on a regular 1 second, then you move onto the next part of the chain.

It may seem obvious, but a logical approach that builds on what you know is working is the only way to go when you are looking at these or any other sorts of problems. Work outwards from what you know works. In your case:

Arduino seems to send messages
You assume that they are reaching the PC but don't know, so you need to verify.
Once this is verified then turn to MIDIOX

Similarly in the reverse direction, although here your midi callback would imply you are not getting messages, you need to prove to yourself that these are actually leaving the PC.
Title: Re: UNO + Olimex Midi Shield
Post by: deseipel on Jan 15, 2013, 07:35 pm
Not sure a terminal prog would work.  Dont forget, the uno isnt connected via a COM port when its running.  Its connected via usb to midi cable, which shows up as a midi device.
Title: Re: UNO + Olimex Midi Shield
Post by: deseipel on Jan 16, 2013, 01:51 am
connected to the UNO usb port to the pc's usb port:

I downloaded realterm, and I definitely see data coming over. 

------------------------------------------------------------------------------------------------------

But I still have no way to see if data comes through my USB to MIDI cable.  When it's plugged into the UNO and then into my pc's USB port, it shows up as a MIDI device, not a COM port (to monitor via a terminal app). 
edit:  I also tried BomeSX MIDI monitoring app, and still I get nothing from the MIDI shield.


Title: Re: UNO + Olimex Midi Shield
Post by: marco_c on Jan 16, 2013, 10:59 am
Are there any other examples of your midi converter used with the arduino? Looks like something is not workin between the two of them.
Title: Re: UNO + Olimex Midi Shield
Post by: deseipel on Jan 16, 2013, 04:33 pm
sort of.  check this out.  This might be the issue, I'm still reading it.:

http://arduino.cc/forum/index.php?action=printpage;topic=115111.0 (http://arduino.cc/forum/index.php?action=printpage;topic=115111.0)


I'll need to check out how the UNO is wired to the Atmega...


Title: Re: UNO + Olimex Midi Shield
Post by: deseipel on Jan 17, 2013, 06:40 am
The post in link I provided above discussed the USB/MIDI cable that I have, in conjunction with the sparksfun midi shield and the UNO and PRO.  but in that scenario, it was the PRO that had 'diminished' mA, as to cause the MIDI signal to be too weak for the USB/MIDI cable to pick it up.  But the UNO + Roland UM1 USB/MIDI cable + Sparksfun MIDI shield was not an issue.  The measured mA on that was 2,5mA under a load.  I have a multimeter, but I'm not really sure how I'd measure mA during a MIDI TX.  ?


What I have been able to determine is:

While the UNO is running, the MIDI OUT and MIDI THRU have 5v on both pins 5 & 4 ? 
Title: Re: UNO + Olimex Midi Shield
Post by: deseipel on Jan 17, 2013, 10:55 pm
Summary:

PC -> Roland UM-1 USB/MIDI cable - > Olimex MIDI shield -> UNO R3  (powered by 9v battery or USB connection (when uploading sketches)

Software:  Arduino IDE 1.0.3, MIDI OX or USBlyzer or SendSX (all are supposed to monitor incoming MIDI or USB ports), MIDI library 3.2

Actions: 

1.  Connect UNO + Midi shield (with jumper removed to allow upload of sketch) via USB to computer
2.  upload a simple MIDI TX sketch, such as:

Code: [Select]

int velocity = 100;//velocity of MIDI notes, must be between 0 and 127
//higher velocity usually makes MIDI instruments louder

int noteON = 144;//144 = 10010000 in binary, note on command
int noteOFF = 128;//128 = 10000000 in binary, note off command

void setup() {
  //  Set MIDI baud rate:
  Serial.begin(31250);
}

void loop() {
  for (int note=50;note<70;note++) {//from note 50 (D3) to note 69 (A4)
    MIDImessage(noteON, note, velocity);//turn note on
    delay(300);//hold note for 300ms
    MIDImessage(noteOFF, note, velocity);//turn note off
    delay(200);//wait 200ms until triggering next note
  }
}

//send MIDI message
void MIDImessage(int command, int MIDInote, int MIDIvelocity) {
  Serial.write(command);//send note on or note off command
  Serial.write(MIDInote);//send pitch data
  Serial.write(MIDIvelocity);//send velocity data
}


4.  observe that TX led blinks on UNO, serial monitor shows data coming across (although its gibberish)
       a.  In addition, using usblyzer, Bulk data transfers are logged. 
5.  disconnect USB cable from UNO
6.  connect Roland UM1 USB/MIDI cable to PC and to MIDI OUT of Olimex MIDI shield.
7.  connect 9v power supply to UNO
8.  Observe that TX led no longer lights up
         a.  although if I code the LEDs on the Olimex to light during main loop, they do indeed light.
9.  Using MIDI OX, selecting UM1 as the MIDI source, no MIDI data transmitted.  Close MIDI OX
10.  Using USBlyzer, select UM1 USB device,  No data comes over the wire.
11.  Volt meter shows 5v on MIDI OUT pins 4,5.
12.  5v on THRU pins, 4,5.

To test the UM1 USB/MIDI cable:
1.  connect UM1 to Korg ES1
2.  press play
3.  loads of MIDI data comes through MIDI OX and USBlyzer



The conclusion that I've reached is that the UNO, by itself, is transferring data across a standard usb cable to the PC/SerialMonitor/USBlyzer (or other port monitor app).  But when the MIDI shield is attached and the standard USB cable is not connected, no serial data is being sent. 

The question remains, how can I verify that serial data (MIDI data) is being send from the TX pin, out the MIDI OUT and across the wire?   I haven't ruled out that it's a mA issue, but that seems unlikely since others have reported the mA under load is about 2,5mA.  I'm not sure how to measure the mA using a standard multimeter, but I would doubt that I'd be able to detect it.   

Title: Re: UNO + Olimex Midi Shield
Post by: deseipel on Jan 18, 2013, 09:53 pm
update:  I picked up some 5v 20mA LEDs and inserted into pin 4 &2 of the MIDI OUT DIN, ran a sketch and the LED blinks.  However I'm unable to read any mA's.  That could be my meter.  I am able to see the voltage drop using my meter.  So it would appear something going out the MIDI OUT DIN? 
Title: Re: UNO + Olimex Midi Shield
Post by: deseipel on Jan 19, 2013, 06:03 am
update2:  new fuse for my meter.  so Ive measured the mA on pins 4 & 5, it's right around 10mA. 
Title: Re: UNO + Olimex Midi Shield
Post by: deseipel on Jan 19, 2013, 05:30 pm
Does anyone have any more ideas for this? 
Title: Re: UNO + Olimex Midi Shield
Post by: marco_c on Jan 19, 2013, 07:11 pm
Sorry, none from me. It looks like the problem is between systems and I don't have any experience with your other stuff.
Title: Re: UNO + Olimex Midi Shield
Post by: deseipel on Jan 20, 2013, 01:38 am
question:  just a simple sketch to use pinMode to turn on D1 and D7 (led on Olimex board) at the same time and off at the same time :  yields strange result:  the LEDs are never on at the same time.

shown in video here

https://docs.google.com/file/d/0B98iPi66Ayy4QTFRQkdSQW9MSGs/edit (https://docs.google.com/file/d/0B98iPi66Ayy4QTFRQkdSQW9MSGs/edit)
Title: Re: UNO + Olimex Midi Shield
Post by: marco_c on Jan 20, 2013, 03:14 am
Hard to tell if it is strange without seeing any code.
Title: Re: UNO + Olimex Midi Shield
Post by: deseipel on Jan 20, 2013, 03:18 am
Code: [Select]
int pinS = 1;  //Serial out pin
int pinF = 7;  //Flag out pin
int pinU = 13;  //Flag out pin

void setup()
{
  pinMode(pinS, OUTPUT);
  pinMode(pinF, OUTPUT);
  pinMode(pinU, OUTPUT);
}

void loop()
{
  digitalWrite(pinS, HIGH);
  digitalWrite(pinF, HIGH);
  digitalWrite(pinU, HIGH);
  delay(2000);
  digitalWrite(pinS, LOW);
  digitalWrite(pinF, LOW);
  digitalWrite(pinU, LOW);
  delay(2000);
}


sorry, it's been a long week fighting with this thing. 
Title: Re: UNO + Olimex Midi Shield
Post by: deseipel on Jan 20, 2013, 05:15 am
Hold the phone, another generous member here messaged me, and it turns out my LED is a "blinking LED".  So this isn't so strange after all. 
Title: Re: UNO + Olimex Midi Shield
Post by: deseipel on Jan 22, 2013, 02:21 am
update:  new, correct type of led inserted into pins 4 & 5 =  rapid fast blinks.   All this seems to say data is being sent.  This seems to indicate the issue is the MIDI/USB cable (Roland UM1)? 
Title: Re: UNO + Olimex Midi Shield
Post by: deseipel on Jan 22, 2013, 05:42 am
What if the mA range that is req'd for MIDI to work, isn't being reached?  According to this

http://www.personal.kent.edu/~sbirch/Music_Production/MP-II/MIDI/midi_physical_layer.htm (http://www.personal.kent.edu/~sbirch/Music_Production/MP-II/MIDI/midi_physical_layer.htm)

It has to be 5mA to work.  If I slow down the baud rate enough, would I be able to detect if it's hitting 5mA to 0mA? 


And for those still reading this saga:  check out oxmidi project.  could be useful.


Olimex finally contacted me and they weren't much help unfortunately.  They test these boards by connecting them to each other and sending MIDI back & forth.  I don't believe they even test these on MIDI devices!  grrr
Title: Re: UNO + Olimex Midi Shield
Post by: marco_c on Jan 22, 2013, 08:10 am
You can try sending a stream of 0 bytes out the port to measure the current. 0 is defined as 5 mA according to the article.
Title: Re: UNO + Olimex Midi Shield
Post by: deseipel on Jan 22, 2013, 06:39 pm
does that mean that the 'rest-state' of MIDI should be 5mA? 
Title: Re: UNO + Olimex Midi Shield
Post by: marco_c on Jan 22, 2013, 09:58 pm
Not sure what you mean by the 'rest state', but the '0' or 'off' signal is 5mA (which is not 'off' at all, but that is the way the hardware standard is defined), sort of inverse logic. I am sure there are good electrical/comms reasons to define it that way, but I don't know whatthey are.
Title: Re: UNO + Olimex Midi Shield
Post by: deseipel on Jan 23, 2013, 12:14 am
On Olimex board,     7.3 mA on D1 & 5v supply: 

4.5mA on MIDI OUT DIN pins 4 &5. 

this is with my meter set on 2m.   Doesn't that seem low?  The running sketch is sending a midi note on and off.

note:  I could very well be reading my meter incorrectly.  I'm still learning

edit: I updated the readings after I realized the meter should be on 2m
Title: Re: UNO + Olimex Midi Shield
Post by: marco_c on Jan 23, 2013, 01:10 am
The current on the LED pins will depend on the LED and the resistors you have put in the circuit, so you can calculate based on theory and see if it is close.

The current on D1 should be the MIDI serial interface.
Title: Re: UNO + Olimex Midi Shield
Post by: deseipel on Jan 23, 2013, 01:30 am
D1 = 7.6mA   (probes on D1 and 5v power supply)

The MIDI OUT DIN pins 4,5 = 4.5mA (is as high as it goes).

This is without the led inserted into the MIDI DIN.  I guess my thought is that, according to what I've read, MIDI operates on 5mA to 0mA.  The MIDI OUT spec only shows  220ohm resistors on pins 4,5 respectively.  So where am I losing .5mA or how can I ramp up the mA?  be gentle.
Title: Re: UNO + Olimex Midi Shield
Post by: marco_c on Jan 23, 2013, 02:15 am
The current should drive an optocoupler (effectively a LED), so in my opinion the 0.5mA is not going to make a big difference to how the LED lights up in the coupler.

Have you checked that the opposite (ie, sending 0xff continuous) gives a current that is at least close to 0mA? That couls also be a problem as the LED would stay at lkeast partially lit.

One other thing that may be worth doing is cheking the specs on the Roland cable to see what is expected there. You may have done this already but there is not info on these posts.
Title: Re: UNO + Olimex Midi Shield
Post by: deseipel on Jan 23, 2013, 02:33 am
The LED isn't hooked up to the MIDI OUT.  And also, there's no octocupler on the MIDI out spec.  I have the board set to send MIDI OUT, so its coming from the board, going through my MIDI/USB cable and into my pc. 

There isn't really a lot of info on my MIDI/USB cable from Roland.  I've used a USB analyzer app that monitors incoming data and nothing registers when I send data through the cable.  The cable works fine with other MIDI devices though.  BUT, if the cable needs the 5mA to register start bits, I'd say it's not getting it.  I don't know if other midi devices absolutely need that 5mA to operate or not.

Title: Re: UNO + Olimex Midi Shield
Post by: marco_c on Jan 23, 2013, 03:43 am
Quote
The LED isn't hooked up to the MIDI OUT


If it follows the standard your MIDI OUT is connected to an optocoupler on the MIDI IN side. There should be something in the middle of the cable you have that is MIDI to USB converter. So it is driving that optocoupler.
Title: Re: UNO + Olimex Midi Shield
Post by: marco_c on Jan 23, 2013, 05:14 am
I just looked up your cable type and assume it is this one http://www.roland.com/products/en/UM-ONE/ (http://www.roland.com/products/en/UM-ONE/).

This cable has indicators on the cable to indicate IN and OUT traffic on the cable?
Title: Re: UNO + Olimex Midi Shield
Post by: deseipel on Jan 23, 2013, 05:51 am
yes, that's the cable.  I don't know what is inside the UM1 cable.  I misunderstood what you wrote earlier.  Yes, each MIDI IN should have an octocupler.

Tomorrow will be the last day I mess around with this.  I'm going to test some simple 'send midi notes' with a real synth (not my pc).  I done this before, but what the hell do I have to lose.  There's got to be something very wrong with what I'm doing or else its the hardware I have is bad.  There's plenty of examples of people doing a lot more with Arduino & MIDI. 

Thursday, I will return the two boards for a refund.  I may decide to go with a different arduino board.  The UNO's limitation on serial ports wasn't something I considered when I purchased it.  I wouldn't mind trying the Rugged Circuits MIDI shield.  If it works, it will be a huge step forward!




Title: Re: UNO + Olimex Midi Shield
Post by: marco_c on Jan 23, 2013, 09:45 am
Fair enough. It must be frustrating.

It is not hard to make your own if you have a soldering iron. I made one that works pretty well. If you are interested, go to the libraries in my footer, look at the midi library and in the main library header file is a reference to a site that has a good circuit that you can build as is or onto a shield.

Good luck.
Title: Re: UNO + Olimex Midi Shield
Post by: deseipel on Jan 24, 2013, 07:55 pm
I did an interesting experiment:

I ran this app, which lets you connect a serial port on your pc to the MIDI device. 

https://code.google.com/p/oxmidi/ (https://code.google.com/p/oxmidi/)

With a normal usb cable plugged into the UNO, I only get data to show up in the monitor when running code that uses serialwrite.   When using the MIDI library, I get nothing.  Also, even when I do get data in this monitor, the notes are really wrong.  I dunno, could be the app.
Title: Re: UNO + Olimex Midi Shield
Post by: deseipel on Jan 31, 2013, 04:18 am
update:

returned both the UNO & Olimex MIDI 'brick'  and ordered the Rugged Circuits Ruggeduino board and MIDI Sheild.  I'm happy to report that, so far, so good.  MIDI OX saw the incoming notes right away from my test sketch. 
Title: Re: UNO + Olimex Midi Shield
Post by: deseipel on Jan 31, 2013, 07:08 am
this code now works beautifully (in MIDIOX thus far, haven't tested with the hardware yet).  It reads for a couple notes, and sends program change msgs up or down; sweet.

Code: [Select]

#include <MIDI.h>
/* set NRPN to set volume to zero for part xyz
read existing program/patch number ???
send stop control
*/
byte P = 1;


void HandleNoteOn (byte channel, byte note, byte velocity){

    //if note1 or note2 is sent, send program change control to go up or down
  if (note == 60){   //need to get the actual note number that I'll assign */
      if (P == 127){P=1;
    MIDI.sendProgramChange(P,10);
      }
      else
      {
        P++;
        MIDI.sendProgramChange(P,10);
      }
     
  }
  if (note == 62){  //need to get the actual note number that I'll assign
       if (P== 1){ P=127;
    MIDI.sendProgramChange(P,10);
 
  }
  else { P--;
  MIDI.sendProgramChange(P,10);
  }
 
  }
  }
 
//if note3 is sent, send nrpn to set volume to zero


void setup() {
 
  MIDI.begin(MIDI_CHANNEL_OMNI);
  MIDI.turnThruOff();
  MIDI.setHandleNoteOn(HandleNoteOn);
  MIDI.sendProgramChange(P,10);

}

void loop () {

  MIDI.read(); //is there incoming MIDI?
 

}
Title: Re: UNO + Olimex Midi Shield
Post by: deseipel on Feb 01, 2013, 05:36 pm
https://www.facebook.com/video/embed?video_id=479320828796254 (https://www.facebook.com/video/embed?video_id=479320828796254)



short video demo-ing the end result of my work on the ruggeduino & MIDI
Title: Re: UNO + Olimex Midi Shield (Resolved)
Post by: deseipel on Feb 09, 2013, 02:07 pm
A final note as I mark this 'resolved':  The final root cause of this was never really discovered.  The ruggeduino boards work perfectly.  Olimex never got back to me with any real results.  I have to conclude it was their shield which was the problem.