Trybotics Logo

Arduino Touch Capacitive MIDI Keyboard

DESCRIPTION

NOTE: I have released a new Instructable on an improved version of this project. It is now capable of handling 12 keys multi-touch input, as well as the option to change from octave. The Instructable can be found here: https://www.instructables.com/id/How-to-Make-a-Cheap-Arduino-MIDI-Controller/

-

This Instructable will show you how to make a touch capacitive MIDI keyboard. If you follow all of the steps correctly, it will work something like this:

Video note: This will not work with normal paint. For this video I used Conductive paint.


What you will need:

- Arduino Uno R3 (this guide is only for a R3, I'm not sure if it will work on other models)
- 12 resistors (somewhere from 1M to 10M Ohm)
- jumper wires
- 11 alligator clips
- some conductive material (electric paint, aluminium foil etc.)
- a software program that can handle MIDI
- touchcapacitive library
- the code & a software file (are provided)

Description:

firstly, we need to determinate the sensitivety of our resistors. To do this, you will need to download the CapacitiveSensor library and install it into your Arduino folder. Then copy this sketch and upload it to your Arduino.


After you finished uploading the code and building the Arduino, open the serial monitor inside your ADE. If done correctly, you will see a row of values. If you're touching the end of the wire, the send-back value should be higher compared to the value when not touching the wire.

Now it's time to determinate at which value your Touch sensor should 'send' out a midi note. If you're reading a value of 50 when your not touching the wire and a value of 1000 when your touching the wire, you should keep the number around 700 in your head. When you've finished building the touch capacitive keyboard, it will sent out a midi note when the value is over 700.

Now it's time to start working on the actual keyboard..

Description:

It's time to upload the code to your Arduino.

Remenber that value you needed to store in your mind? You need to put that value in the code. Everywhere in the code where stands a 500, you need to change in to your value.

static int lastInput1 = 0;

int newInput1 = total1;

if((lastInput1 < 500) && (newInput1 > 500)) {

for (int note=48;note<49;note++) {//from note 50 (D3) to note 69 (A4)

MIDImessage(noteON, note, ON); }};//turn note on

if((lastInput1 > 500) && (newInput1 < 500)) {

for (int note=48;note<49;note++) {//from note 50 (D3) to note 69 (A4)

MIDImessage(noteON, note, OFF); }};

lastInput1 = newInput1;

After you changed the value the code is ready to be uploaded.

Description:

Now it's time to change the default UNO-dfu_and_usbserial_combined software on your arduino to a MIDI software.

first download the hex file and the FLIP program to upload the hex file to your Arduino.

When you downloaded the file and FLIP, connect your Arduino to your computer. Now it's time to put your Arduino Uno R3 (this will only work on a Uno!) into DFU mode.

Put one wire into the Ground at the top and one to the Ground on the bottom. You need to touch the bottom wire to GND showed on the photo and the top wire to RESET on the photo at the same time. Your Arduino should be into DFU mode now.

Then it's time to upload the MocoLUFA hex file. Open FLIP, select your chip (16u), locate your MIDI.hex file and upload it via USB. Disconnect your USB cable from the computer and connect it again. The Arduino should come up as a MIDI/MocoLUFA device.

remember: When you need to change your ADE code, you need to put Arduino original hex file back. It can be found under C:\Program Files (x86)\Arduino\hardware\arduino\firmwares\atmegaxxu2

Description:

build the circuit as in the pictures.

The end of the wires is where you would touch it. You can attach alligator clips to the ends of the wire so you can clip the wires to alliminium foil for example.

Description:

your Touch capacitive keyboard should be finished by now. It can detect when you're holding a wire and send out a midi note. But we need also a program that can read MIDI and can produce sounds. I would suggest you use a DAW (Fl Studio, Ableton, Logic Pro etc.)

If your Touch capacitive keyboard is working as it should be, it will appear as a normal MIDI device in your DAW as shown. It will work like any normal MIDI keyboard, except that it can only play one note at the time! 

enjoy it!


YOU MIGHT ALSO LIKE