Gobs:
If you want to get MIDI over USB to work, you need to 1) upload a sketch to the board 2) flash the firmware 3) now the Arduino should be recognised as USB device, correct? However to upload sketches again
Correct. To upload sketches again, you have to 1) flash the Arduino Serial firmware again, 2) upload the new sketch, 3) upload the MIDI firmware again.
This is very cumbersome indeed, so I'd recommend using the Debug MIDI interface for debugging, so you don't have to reflash the firmware all the time. The Debug MIDI interface works with the standard Arduino firmware, and just prints out the MIDI messages to the Serial Monitor as plain text. MIDI_controller/examples/Ex.10.Debug-MIDI/Ex.10.Debug-MIDI.ino at master ยท tttapa/MIDI_controller ยท GitHub
You can also use the HairlessMIDI_Interface and use it with the Hairless MIDI<->Serial bridge.
Once that's working, you can upload your final sketch (with the normal USBMIDI_Interface!), and flash the MIDI firmware.
Gobs:
Two links are provided for firmware on your GitHub, to the .hex file and to the HIDUINO GitHub page, I do not understand the difference?
They are the same, the second (arduino_midi.hex) is just a direct download link (the first one is the file on GitHub). Use the second one (raw.githubusercontent...), and save it (CTRL+S).
Gobs:
In your documentation on the GitHub, you say that you have a script which will "download and install the firmware to the Arduino." Does this mean I didn't need to download the firmware in the first place?
The script is for Linux only. On Windows, you'll have do it the long way.
Gobs:
On the HIDUINO page, there is a section in the quickstart that says the following:
I do not know what an ISP is (it's not explained in the Git), but this seems quite convenient. Is there any reason I wouldn't be able to do this? And what is an ISP?
An ISP is an In-System Programmer.
The connection of the Arduino MEGA are as follows:
USB UART
Computer โ ATmega16U2 โ ATmega2560
The main microcontroller of the MEGA is the ATmega2560, and it can't speak USB. So to upload sketches over USB, you need a second microcontroller, the ATmega16U2 that translates between USB and UART.
The ATmega2560 has a bootloader that receives a new sketch over the UART.
The 16U2 shows up on the computer as a serial communication device. This means it can't speak MIDI over USB.
When you flash the MIDI firmware to the ATmega16U2, it no longer shows up as a serial communication device, but as a USB MIDI device, and it translates between USB MIDI and UART MIDI.
However, now you can no longer upload sketches to the ATmega2560, because it only talks MIDI now.
There is a second way to upload sketches to the 2560: using an ISP over the SPI bus. This bypasses the 16U2 and the bootloader entirely, and it even erases the bootloader IIRC.
You need an extra device, the ISP programmer, that translates between USB and SPI.
MIDI over USB MIDI SPI USB
Computer โ ATmega16U2 โ ATmega2560 โ ISP Programmer โ Computer
Now you can use the USB port of the Arduino for MIDI, and the USB port of the programmer for uploading new sketches.
Because it requires extra hardware, and because I didn't want to complicate matters even further, I left that out.
As I said before, just use the debug interface and Hairless for prototyping, and then when you've tested it, flash the MIDI firmware as a final step. Then you don't have to worry about not being able to program the Arduino. If you want to go back, you can always flash the original Arduino firmware again.
As you've discovered, it's a complicated process. Teensies, Arduino Leonardos and Arduino Dues are just plug and play, because their main microcontrollers speak USB natively (including MIDI over USB).
The Arduino MEGA and UNO are just not suited for MIDI over USB. I added the instructions because some people don't have anything else, but if you have the choice, you'll spare yourself a lot of problems if you get a Teensy 3.x board.
Hope this clears some things up.
If you have any more questions, just ask!
Pieter