Introduction: Arduino MIDI Controller
A MIDI controller is any piece of equipment that generates and transmits MIDI data to MIDI-enabled devices. In short, if you have buttons on your MIDI controller, you can program those buttons to any sound you want through musical software (ex.: Ableton, Garage Band, etc.). You can also program potentiometers to control effects, volumes, etc..
This instructable will show you how to create your own MIDI Controller using Arduino. With a MIDI controller, you are rarely limited with what you can do. There is endless possibilities and endless fun.
Step 1: Gathering Materials
Tools:
- Soldering iron
- Solder
- Small gauge wire (three colors ideally)
- Wire stripers
- Wire cutters
- Phillips-head screwdriver
- Laser cutter
Materials:
- 1 x Arduino UNO
- 560 ohms resistor
- 12 x White Sanwa Push Buttons OBSF-30-W
- 4 x 10k linear potentiometers
- 4 x Pot knobs
- 2 x 10k linear sliding potentiometers
- 2 x Slider knobs
- 4 x M3 - .5 x 6mm Pan Head Screws
- Acrylic sheet(s) (the amount of acrylic sheets depends on how big your laser cutter bed is)
Step 2: Designing Enclosure
Step 3: Wiring and Soldering
Arcade Buttons
You will now want to push the buttons through the holes. You will want to push them slowly in so that you do not crack the acrylic. Once the buttons are in, you will want to solder a wire to one of the legs on every arcade button (looking at the backside of the buttons). This will be the data wire. Make sure the wires are the same color and on the same leg of each of the arcade buttons. I used red wires for this. Also, you need to make sure that the wires are at an appropriate length so that they reach the Arduino that is placed in the top left corner (looking from above). The bottom right corner button (looking at the backside of the buttons) will need to have a wire soldered to the same leg as the other buttons but it will go up to the pot potentiometers so measure the length of the wire accordingly.
On the button in the bottom right corner (looking at the backside of the buttons), you will need to solder a 560 ohms resistor to a short piece of different colored wire that will then be soldered onto the ground leg of the button which is the leg that is not already occupied. I used blue wire for this. On the other side of the resistor solder the same color wire on so that it reaches the other ground leg on the next button. Then solder that wire. To the same leg, solder the color wire that you used for the data pins (red) onto that leg as that wire will serve as the data pin.
On the next button to the left of it, solder another wire to the ground leg that reaches the next ground leg on the next button and then solder that wire to the ground leg. Continue the process until the last button. As you are connecting the ground legs with wires, move to the left (looking at the backside of the buttons) and then go up as you reach the end of the row and the go to the right until you are at the end of the row. At the end of the row, solder a wire onto the ground leg that will go to the GND pin on the Arduino so measure the wire accordingly.
Potentiometers
The wire that comes from the arcade button that has the resistor on it needs to be soldered to the pot potentiometers. The wire needs to be soldered on the bottom prong of the potentiometer. Once this is done, stick with the same color of wire (red) to connect all of the potentiometers including the sliding potentiometers. This wire will be the power. Make sure to connect the wires to the same prong throughout soldering. On the same prong of the pot potentiometer that connects to the sliding potentiometers, solder the same color wire (red) onto the prong. This wire will go into the 5V pin on the Arduino so measure the length accordingly.
On the top prong of the pot potentiometer that is directly connected to the arcade button, solder a different color wire (blue) onto it and then connect this wire to all of the potentiometers including the sliding potentiometers. Once all of the potentiometers are wired together, solder the same color wire (blue) onto the same prong of the last potentiometer that you connected. This wire will go into the GND pin on the Arduino so measure the length accordingly.
On the prongs of the potentiometers that do not have wires on them, solder a different color wire (yellow) onto the prongs. Make sure you measure the lengths of these wires so that they can reach the Arduino. These wires will go into the ANALOG IN pins of the Arduino.
Step 4: Connections
DIGITAL
The wires that are the data wires on the arcade buttons will go into the DIGITAL pins. These wires should go into the pins how they are aligned. For example, if I was connecting the data wire for an arcade button to DIGITAL pin 5, the data wire for the arcade button next to it would go into DIGITAL pin 6.
ANALOG IN
The wires that are the data wires on the potentiometers will go into the ANALOG IN pins. These wires should go into the pins how they are aligned. For example, if I was connecting the bottom right pot to ANALOG IN pin 0, the data wire for the top right pot would go into ANALOG IN pin 1.
5V
The free wire that is connected to the pot potentiometer goes into the 5V pin on the Arduino.
GND
The free wire that is connected to the arcade button goes into the GND pin on the Arduino. The free wire that is connected to the sliding potentiometer goes into the GND pin on the Arduino.
Step 5: Constructing
Connect the sides to the bottom piece, back piece, top piece, and front piece. On the joints where the pieces connect, you will want to put a small amount of hot glue on. You do not need a lot. It should look like this up to this point.
Before putting the pieces with the arcade buttons and the potentiometers on, consider glueing the Arduino down. This is optional. However, it might be easier to connect the USB cord to the Arduino. Now, connect the pieces that have the arcade buttons and the potentiometers onto the base. If you want to be able to take these pieces off, do not hot glue them. If you want to glue these pieces down, you can.
Step 6: Programming
Once you have all of the wires connected to the Arduino, you now need to program the Arduino. The code below will be the code that you want to compile into your Arduino. When it asks you if you want to "Create this folder, move the file, and continue?", press "OK". Now, verify and upload the code.
Attachments
Step 7: Software
The code in the previous step only sends MIDI messages over a standard serial port. You'll need to map those MIDI messages from the serial port to a MIDI port. To do this, you will need two pieces of software.
Firstly, you'll need a virtual MIDI port. This will connect you to your audio software. If you are using OS X, like I did, you can use IAC Driver under Audio MIDI Setup to create a MIDI port. To do this, you can follow these instructions. Make sure to set up two ports, one named "Output to Audio Software" and the other named "Input to Audio Software". If you are using Windows, use MIDI Yoke. To install the driver on Windows Vista or Windows 7, you will need to disable UAC.
To convert MIDI serial port messages to MIDI port messages, you will need the second piece of software called Serial-MIDI Converter. It can run on Windows, Linux, and OS X since it is Java based. If your computer does not have Java, you will need to instal it.
Now that you have setup everything, open the Serial-MIDI Converter and type in the numbers that correspond with your Arduino and ports. To know if your MIDI controller is working, press the buttons and the Serial RX square should be lighting up green.
Step 8: MIDI Mapping
Mapping is the process of configuring the potentiometers and buttons to what you want them to do through audio software.
Open up your audio software and begin mapping your MIDI controller. The process of mapping depends upon your audio software so you will need to figure out how to map with your software. With Ableton, it is done by selecting what you want to map your controller to, press the button or potentiometer you want to map it to, and unselecting the effect, sound, etc. Mapping what you want where you want is completely up to you as there are no restrictions. For example, here is what I mapped my MIDI controller to:
Buttons 1-12: drum sounds
Pot 1: reverb amount
Pot 2: flanger amount
Pot 3: phaser amount
Pot 4: chorus amount
Slider 1: volume amount
Slider 2: pitch
49 Comments
Question 3 years ago
Super cool. What would be the code for an Arduino Nano and just 3 faders? I neet a small box to control orchestral libraries
Answer 3 years ago
Hello,
I would suggest taking a look at this library: https://github.com/tttapa/Control-Surface
There are some pretty in-depth instructions at the bottom on how to program pretty much any Arduino midi controller.
For just 3 faders, I think you would have to only write about 7 lines of code!
Hope that helps, and good luck on your project!
Reply 3 years ago
Yeah I did exactly that, simplest code ever
Question 3 years ago on Step 7
Hi
I have a question - what programs should I take for Linux? I have ElementaryOS 5.0 Juno and im not sure which software I could use to this project
4 years ago on Step 6
Tank you may frend
4 years ago
I have some question about arduino uno can you give me arduino code for 16 buttons please
7 years ago
can you give me code for 16 potentiometer f for arduino mega. i have code for uno only and i dont know how to chage it for mega.
Reply 4 years ago
Hi can you give me code for arduino uno I'm using 16 buttons please
7 years ago
Is the max inputs only 18? If I wanted to exceed this is there a way to link multiple arduino to one input?
Reply 4 years ago
How to program it
Reply 6 years ago
Use a matrix keyboard instead of a one to one kyeboard to input. For instance in order to get 16 keys you will only need 8 pins (4+4 cables to make an 4*4 matrix)
Question 5 years ago
Hi, I wondering, is it possible to push 3-4 or more buttons in same time and if YES are they working correctly?
Question 5 years ago on Step 8
Is there a way to use one of the effect buttons as a bank. So that you have more options for drums and samples
5 years ago
I am really wanting to make my own midi controller for a digital guitar rig. Seems like its pretty normal when i look online to find ideas for program changes. Those seem to be typical. However, I am wanting to add a deeper layer function or possibly a second "mode" to perform midi control changes as well. How do I know which board is appropriate for this need? new to the idea of making my own but knowledgeable in midi, etc... I have a manufactured pedal that is close, but lacks the programming to do what i want. The manufacturer says the feature will be added late next year in firmware update... NOT WAITING IF I CAN JUST MAKE ONE! would love input from you guys!!! THANKS IN ADVANCE!
GSHARP9
Reply 5 years ago
also, forgot to mention, need to do all of this through USB Midi.....
6 years ago
Please how i can change one pot slide for a sensor ultrassonic ? i want use for
fade....
6 years ago
I am able to download the Seial-Midi Converter by searching for it online. I download it just fine but cannot launch the executable file.
Has anyone been able to work it out?
maxdeforest@gmail.com
6 years ago
Congratulations! Just a question: I'm not able to download Seial-Midi Converter from the link becouse it do not allow. Please, may you suggest where I can find it? Many thanks.
Looking forward, have a nice day!
Gian Battista Pettinelli
gianbattistapettinelli@gmail.com
Reply 6 years ago
Same. Please, can you help us?
6 years ago
There's the best way to use multiplexer