A MIDI controller can send and receive MIDI messages to your PC, allowing direct control of your software. Not only that, but the controls can generally be mapped to anything your like. So what might be a volume fader for one person can be an effect filter for another.
This article will describe how to build and program a custom arcade button MIDI controller, while trying to keep the price below $100. It is aimed at electronics and programming novices.
Remove these ads by
Signing UpStep 1What You'll Need
Required Components
1 x DFRduino (cheaper Arduino clone) $28.80
1 x USB cable (A to B connector, like that on a printer) $3.95
1 x Plastic enclosure $15.75
12 x Sanwa 24mm arcade buttons $26.28 (USD)
4 x 10k linear potentiometer $4.88
4 x Pot knobs $3.80
2 x 10k linear sliding potentiometer $7.54
2 x Slider knobs $2.04
5 x 10mm M3 nylon threaded spacers $2.00 (I got a bag of 25 for $9.95)
4 x 16mm countersunk M3 screws $1.00
3 x 4mm M2 self tapping screws $0.75
1 x 4.7 kΩ resistor $0.10
4 x stick on rubber feet $2.00
Total $98.89
All of the above can be found at most online electronics stores (I use the excellent Little Bird Electronics ), except for the Sanwa arcade buttons which can be found at arcade replacement parts stores, or from DJ TechTools . It pays to purchase one or two spare buttons and perhaps a spare potentiometer in the event that the part is faulty or you accidentally make it faulty.
Required Tools
Soldering iron
Solder
Wire stripper
Small gauge stranded wire (22 AWG), preferably in three or more different colours
About 1m of 2.5mm heat shrink
Power drill or drill press
Drill bits (2mm, 3mm, 7mm, and 11mm)
Spade bit (24mm) $12.49
Countersinking bit
10mm hexagonal wrench or spanner
Needle-nose pliers
Small riffler files $15 for pack of 10
Regular file
Phillips-head screwdriver
| « Previous Step | Download PDFView All Steps | Next Step » |

































![Beatfly : Make an illuminating blimp and control it with your voice, Keyboard, MIDI Controller, Garageband file, iPhone, Flash, and more! [Mac OSX]](http://img.instructables.com/files/deriv/F1M/MOZ0/G56ZPYN9/F1MMOZ0G56ZPYN9.SQUARE.jpg)
















I'd say they're the same, but I could be wrong
Note the travel length is marked as 60mm, but for the groove of the slider you'll want a 5mm gap on either side of the travel to accommodate the slide lever.
thanks!
Another way would be to compile the teensy code as normal, but then flash the hex file using an In-System Programmer directly to the chip, and not having a bootloader at all. That said, a bootloader makes things much easier, so use a bootloader if you can!
i uploaded correctly your sketch on the Atmega32u4 Breakout Board and set it as midi device. (it seems it works).
this board is identical to the teensy, only that the pins are in different positions.
this is my project using 16 pushbutton and 9 potentiometer 1MΩ.
what you think about? will i have to change somethings on your sketch?
thanks!!
The design looks good. You will have to tweak a few lines of the sketch to match the number of analogue and digital inputs, and the pins to which they're connected.
The code you'll need to update is on lines 129, 131, 173 and 186. Change NUM_DI to 16 and NUM_AI to 9. I'll leave the pin mapping changes to you :) Good luck!
One more thing - the ATmega32u4 datasheet (section 24.7.1) mentions the input impedance (resistance) recommended for the analogue to digital converter is no more than 10kOhms. Beyond that, the time it takes to convert the analogue signal into a digital one may take longer.
This probably won't be a problem with the 1MOhm pots as they won't be moving at super high speeds. If you do see delayed or lagging behaviour of the sketch with all of the pots connected, this may be the cause.
Disclaimer: I've never used anything higher than 10kOhm pots with an ATmega, so I have no actual experience here. I'm just quoting the datasheet!
i changed 129 and 131 lines, and:
#elif defined(TEENSY_2)
#define DIGITAL_PIN_ORDER 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
#elif defined(TEENSY_2)
#define ANALOGUE_PIN_ORDER 0, 1, 2, 3, 4, 5, 6, 7, 8
i have i strange issue too: when i upload your code (both on Atmega32u4 Breakout Board and on teensy 2) the boards send midi message without any pin connected and any activity (only usb connected). (they send chan16 ; controller 20 / 21. this sending is intermittent.)
thanks
When nothing is connected to the analogue pin, it doesn't have a defined electrical value. In other words it's not being pulled in any particular direction, and is considered floating. This floating value can change at any time due to any number of factors.
To guarantee the input isn't floating, it needs to be tied to an electrical value, usually ground. So if a pot isn't connected to the pin, the pin should be connected to ground.
Alternatively you can remove unused analogue inputs from the sketch to ignore their floating values.
Thanks a lot for this instructable, I'm just having 1 issue.
I have an Arduino Uno and I've connected/wired everything correctly. I uploaded the Jan 2012 version of the code, which was fine, but whenever I run the device the TX and RX serials aren't operating. I have not altered any of the parts or changed any of the code, i'm just not getting any serial reads from my arduino. Do you have any idea why this would be? I've tried a bunch of Arduino's official troubleshooting guides and nothings working.
Thanks for any help,
Cheers.
Whenever I press a button or use the faders/knobs the TX Serial light comes on the Arduino and in the Midi Serial Converter the RX Serial light lights up. I thought this might have been a solution but when I go to map the controller to Ableton Live it doesn't respond to any of my input.
http://www.youtube.com/watch?v=WJrO9VYEoGQ
I did research on the net found the pressure sensitive sensors. i.e. piezo sensor
I bought arduino and followed your instructions.
It's working now
but piezo sensor not working like pressure sensor.
Its working, only when i connect ground and any input (like button switch)
What is the solution for pressure sensitive piezo ?
Should I need to change in the programming or not?
Basically I want to make midi controller for computer
I want to use FPC VST in FL studio for my midi drums.
and other problem, there is only 12 digital inputs in arduino board
I want more. I need minimum 16 digital input.
Is there any way to convert analog input into digital?
And, on Serial MIDI Converter, the TX doesn't flash green. What's happening
Do you have any idea?
I'm a newbie, so please, be patient.
I've been trying to make my midi controller work, but I've come across two question: the first is about the incoming and outcoming ports to be used when under mac os 10.7?
About the sketch, I noticed there are conditions written specifically the arduino mega and others; mine, is uno. Do I have to change anything in order for the sketch to work correctly with my equipment?
Thanks in advance!
In terms of the sketch, it should run fine on the Uno without any modification. The conditions only come into effect when compiling for the Mega or Teensy.
I have my controller completely built just need to wire it up and program it. before I jump to the programming portion I had one more question!
A few weeks ago I found a tutorial on how to add instant gratification (multiple buttons pressed together creates a different effect than just one button). I apparently forgot to bookmark that tutorial :/
It came from the midifighter being able to have a certain effect if 1,2,3,4...etc buttons are pressed instead of the one individual button. But I do not believe it used the midifighter section of your program.
Do you know how to add this programming? Or does anyone by chance know where that tut. is?
Thanks again for your help!
James
Look at the instant gratification layout .tsi and you can figure it out how to map the same type of deal yo your own controller.
and i just got little bit of confused from ur programming section info. can u plz upload a video of it or explain it briefly. im electronics student but the things u said i get confused on it. plz help.
Does that clear things up?
I have just one question i'm total a newbie on electronic sorry.
the resistor is a 4.7 kohm but what watt i need ?
thank you
So exactly what number of buttons and pots could be used?
I also noticed they have a Teensy ++ http://www.pjrc.com/store/teensypp.html
which would just allow for more buttons and pots?
How hard or would it even be possible to put in some sort of jog wheel/ scratch wheel into this set up? Meaning is it possible to do with the teensy?
thanks for your prompt reply!
If you did go with the Teensy, you'd first have to load the sketch on to it from the Arduino software. From there all you'd need to do is plug it in and configure the MIDI mapping in your DJ software.
There are up to 12 analogue inputs and 13 digital IO for the Teensy 2.0 (you can have up to 25 digital IO, but you must use the analogue input pins). The Teensy++ 2.0 has 8 analogue inputs and 38 digital IO (or up to 46 digital IO when using the analogue pins). So it has more digital IO, but fewer analogue inputs.
Adding a jog wheel (aka a rotary encoder) to the setup would require some code changes to the sketch. I'm in the process of doing a complete rewrite of the source code, and hope to include more IO options such as jog wheels. It won't be done for a while yet though.
Thanks for the great instructable! :)
You'd need to setup larger arrays for the button states coming in from the shift registers, and some logic to determine when you are reading from the on board IO and when you are reading from the shift registers.
Adding an analogue multiplexer would require similar changes, with larger arrays and on board/multiplexer logic.
So in short it's not a total rewrite, but does require a number of software and hardware changes.
I just learned about the Arduino Mega and Mega 2560... Would it be easier to use one of them over the Teensy++? Does your code already support it?
The advantage of the Teensy is that it can act as a true USB-MIDI device, unlike the Arduino which requires software on the PC to convert its serial messages to MIDI. The other advantage is that it's a fair bit cheaper.
That said, if you just want more I/O then the Mega should be fine and won't require any code changes.
In case you haven't seen it before: http://www.instructables.com/id/A-Framework-For-Making-Affordable-Stylish-Modula/
This instructable is another interesting one; I thought maybe you might be interested in looking at the code.
I'm really interested in having encoders... 8 of them! gah - I'm trying to make this so multi-purpose, I'm not sure I'm going overboard, but I've already got encoders ($30 worth!) given to me free, so I might as well work them in, right? :P
Anyway, I didn't know if seeing that code might help you out with your rewrite.
Cheers, and thanks again!
I went ahead with the teensy 2.0 and will be putting it all together here in the next couple of weeks. I would be very interested to see what you come up with the jog wheel though. If you do figure that out it would be very highly appreciated if you contacted me about it. just let me know the best way you would like to contact me.
Ill let you know how my custom case and final product turns out. Thanks again for the replies and great work you have done here!