MIDI over USB with Arduino UNO MIDI_controller Library

( Arduino UNO - Windows 7 )

Hi,

Can anybody help? I am also very new to this.

My main issue at the moment seems to be that (as far as I know) I have followed the steps to;

+Installed the MIDI_controller library

+Installed the PJRC Encoder library

+Installed latest Java Runtime Environment

+Installed Atmel Flip

+Arduino Uno or Mega
"Open one of the example sketches*, connect your Arduino, select the right port from the Tools
menu, and hit upload. When the upload is complete, take a ballpoint pen (or anything
conductive) and reset the ATmega16U2 by connecting the reset pin of the 6-pin ISP header
(next to the USB connector) to ground"

*I used the example Blink sketch that comes with Arduino IDE to keep it simple and easy (if
this matters at all? Or do you mean I should have used one of the example sketches of
the MIDI_controller library?)

+I touched the 2 pins with a jumper wire, and an LED on the UNO flashed several times (i
know, not related to the sketch i used) , so
something happened here, i think it reset
successfully

+In device manager i updated/changed/installed the driver to C:\Program Files\Atmel\Flip 3.4.7\usb

FROM THE GUIDE: ("You should get a notification that Windows has successfully updated the driver software for AT90USB162

But

I do not recall seeing the AT90USB162
number at this stage, but the install seemed to be successful anyway (or does this mean it is not?).

At this stage I remember that the Arduino UNO no longer showed up in device manager as COM5 under Ports (COM & LTP), nor did it have the COM 5 option in the Arduino IDE port drop down list.

+Download the ATmega16U2 firmware:

+I downloaded the Arduino-usbserial-atmega16u2-Uno-Rev3.hex

+I downloaded Dimitri Diakopoulos's HIDUINO firmware from his GitHub page: arduino_midi.hex

Then I follow the rest of the steps which are as follows;

"Flash the MIDI firmware:

1.Open the Flip software.

2.Hit CTRL+S to select a device, choose 'ATmega16U2', and click 'OK'.

3.Hit CTRL+U, and click 'Open' to open the USB connection.

4.Hit CTRL+L to load a HEX file.

5.Browse to your Downloads folder and load the 'arduino_midi.hex' file you just downloaded.

6.Make sure all 4 boxes on the left hand side are checked, and click 'Run'.

7.Once this is finished, you can unplug the Arduino. Now it is no longer in DFU mode.

8.Go back to the Device Manager, and check if the Arduino shows up as a MIDI device, under
'Sound, video and game controllers'.

9.Now your Arduino is a working MIDI controller!

10.To upload a new program, just repeat these same steps again, but use the Arduino
firmware you downloaded previously.

This confuses me a little. Do we need to flash both the Arduino-usbserial-atmega16u2-Uno-Rev3.hex and the HIDUINO arduino_midi.hex, or only the arduino_midi.hex?

Only the arduino_midi.hex is in the instructions of what we should do in Flip software at this stage.

I believe I did both anyway, and now, currently, my Device Manager in Windows 7, shows

arduino_midi under the Sound, video and game controllers section (which I believe is what I want).

It no longer shows as COM5 port in device manager, and no longer comes up as COM 5 in Arduino IDE.

Is this correct?

Next, I have loaded the example Potentiometer sketch from the library. If i connect my potentiometer on a breadboard (correctly), and use the A0 pin, like in the code, should this code work 'as is' without me changing anything? If i try and 'upload' the sketch, it is not successful. Should it be? There is no COM port recognised for the device anymore.

I've tried controlling something in cubase, but nothing, I'm not sure I'm doing it the wrong way, or whether I have not successfully set it up right in one of the many earlier stages, so that it can not work in its current state?

I thought maybe I'd just go back and try again, but now i can't suss out how to reset the board back to the beginning before I started.

If i go into flip software and choose my device as being ATmega16U2, then press Control + U to to open the USB connection, it says Could not open USB device. So now I',m not able to load any other HEX files.

Additionally, I can't go back to the stage where i touch the 2 pins with the jumper wire to start the process again, because nothing happens.

My arduino still shows up in device manager as arduino_midi under the Sound, video and game controllers section, and also as a MIDI device in my DAW, but nowhere else (not as a COM port in device manager under Ports (COM & LTP) or in Arduino IDE.

ANY help or guidance you can give me, in layman's terms, for a complete newbie like me, would be so much appreciated!

Maybe I am already at the place i need the board to be at to start using as a MIDI controller, but I need a simple way to test if my board is connected up properly, and is 'speaking' to the computer properly. Also, some confirmation as to to whether the example sketches will work exactly as they are, without being completely changed, would be highly appreciated!

Many thanks :slight_smile:

My arduino still shows up in device manager as arduino_midi under the Sound, video and game controllers section, and also as a MIDI device in my DAW, but nowhere else (not as a COM port in device manager under Ports (COM & LTP) or in Arduino IDE.

Yes that is correct it will not show up in the other places. Why would it? It is no longer a serial device it is a MIDI USB HID device.

What you are trying, as you have found is a long and complex procedure. I would not recommend it to an advanced user let alone a beginner.

if my board is connected up properly, and is 'speaking' to the computer properly.

Yes it is, if it shows up in the DAW it is connected correctly.

You need something like a MIDI monitor to look at all the messages it is sending.

The big problem is that you have the wrong Arduino board, a Uno is not suitable for this and there are much simpler procedures using other types of Arduino.

I would recommend you get a Leonardo or Micro, or even a Teensy. You will have a much easier ride.

If i try and 'upload' the sketch, it is not successful. Should it be? There is no COM port recognised for the device anymore.

Any MIDI code should have been loaded into the Arduino first before this messing with the USB chip. To load code in you now have to use a programmer, or revert the USB chip back to a serial port so it does show up in the IDE.

Thank you for your response in this matter, it’s really helpful.

I had read that it might be problematic with an UNO, but I was convinced otherwise with the guide i found that made it seem possible and fool proof. ::slight_smile:

Do you know the best way to go about restoring the board to before i did any of this? I’d have thought it would be easy enough, but i’m really struggling to find a solution i understand anywhere online.

Many thanks again.

EDIT:
I just ordered a Pro Micro

To upload a new program, just repeat these same steps again, but use the Arduino
firmware you downloaded previously.

This confuses me a little. Do we need to flash both the Arduino-usbserial-atmega16u2-Uno-Rev3.hex and the HIDUINO arduino_midi.hex, or only the arduino_midi.hex?

To get back to a working Arduino you have to just flash the Arduino-usbserial-atmega16u2-Uno-Rev3.hex only.

Thank you, sir!