Skip to content
An arduino based touchpad MIDI over USB device
C++
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
documentation/images
src/arduino-midi-touchpad
README.md

README.md

arduino-midi-touchpad UNO

An arduino based touchpad MIDI over USB device

Author : Nicolas Debras (nicolas@debras.fr)

Demo video : https://www.youtube.com/watch?v=MqDizxunnVw

Arduino MIDI Touchpad

This is a touchpad sketch turning an Arduino UNO and a Adafruit 2.8'' TFT Touchscreen into a MIDI device able to send control change message over USB.

It is based on this article : https://www.instructables.com/id/Turn-your-Arduino-Uno-into-an-USB-HID-Mididevice/

It uses the following libraries :

Arduino UNO R3 is available here : https://shop.mchobby.be/fr/carte-arduino-officielle/10-arduino-uno-r3e-atmega328-assemble-3232100000100-arduino.html?search_query=arduino+uno&results=485

TFT shield available here : https://shop.mchobby.be/fr/shields/384-ecran-tactile-28-tft-pour-arduino-3232100003842-adafruit.html?search_query=arduino+TFT+shield&results=560

The Arduino Code

The code (src/arduino-midi-touchpad/arduino-midi-touchpad.ino) is, I think :-), well commented and self explanatory. If there is something unclear, if you have any suggestions, remarks or optimisations, feel free to contact me : nicolas@debras.fr

Flashing the UNO USB controler

As I'm using a Macbook, the explanation here are based on the tools I'm using. The is an equivalent for the Linux and Windows world too, but can't test them for now (If someone can document this, please do!)

The tricky part of this small project is flashing the USB controller of the Arduino UNO R3 to turn it into a class compliant MIDI device.

AVRDude

First you need to acquire a AVRISP programmer available for a few euros on all electronic e-shop (I bought mine here, it worked straight forward on my MacBook Pro : https://www.electronic-shop.lu/product/135800)

Then you have to install avrdude, which is the tool you're going to use to properly flash the USB controler of the UNO. Just follow step by step the information given on this page : http://macappstore.org/avrdude/, it's quite simple.

You need to know is that, once the USB controler of the Arduino will be acting as a MIDI device, you won't be able to send code updates using the Arduino IDE anymore. So, for now, we will have to flash it to MIDI and revert it along the development process. I read that there is a better way of doing but haven't managed to do it for now.

Flashing the USB controler to MIDI

Arduino AVR ISP Flash

What we wanna do know is to get the USB microcontroler code the will make it act as a MIDI class compliant controler. To do that git clone this repository : https://github.com/ddiakopoulos/hiduino The go in the hiduino/compiled_firmwares directory. Find out to which USB port your AVR ISP Programmer is plugged to. On MacOS, just have a look at the /dev/ directory with ls /dev/. In my case, it is /dev/cu.SLAB_USBtoUART. So, adapt the -P argument and execute the following command in the terminal :

avrdude -p at90usb82 -F -P /dev/cu.SLAB_USBtoUART -c avrispmkii -U flash:w:arduino_midi.hex -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m -U lock:w:0x0F:m

Your Arduino should now be recognized as a MIDI device by computer. Arduino as a MIDI USB Device

Revert to USB controler to it's original state

The original USB microcontroler code can be found in the Arduino IDE package. On MacOS it is located here : /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/firmwares/atmegaxxu2

To revert the USB microcontroler of your Arduino UNO R3 back to the original, adapt the -P argument and execute : avrdude -p at90usb82 -F -P /dev/cu.SLAB_USBtoUART -c avrispmkii -U flash:w:UNO-dfu_and_usbserial_combined.hex -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m -U lock:w:0x0F:m

arduino-midi-touchpad MEGA

You'll find in the src directory, a version of the code in order to user the same TFT touchscreen with the arduino MEGA and with bluetooth capabilities. I'll document it soon.

You can’t perform that action at this time.