Author Topic: Arduino MIDI Controllers  (Read 16435 times)

0 Members and 1 Guest are viewing this topic.

Offline Elantric

Arduino MIDI Controllers
« on: May 07, 2013, 10:29:37 AM »

Knobber - USB MIDI single knob/button controller by Echolevel

Well, here it is: the Echolevel Knobber! A tiny, class-compliant, USB MIDI controller with precisely ONE knob and ONE button. I always wanted something like this and could never find one on the market; fortunately, once the Teensy USB Development Board came of age,

making my own became very straightforward. The Teensy is an Arduino-like dev board with two major advantages (for me) over Arduino: it’s extremely small while still having a USB (micro) connector, plus it natively acts as a class-compliant USB MIDI device allowing plug’n’play use on modern versions of OS X, Windows, iOS and - to a certain extent - Linux. Why? Well sometimes you’re working in a coffee shop or playing live on a very tiny amount of table space, and you don’t *need* the 8+ knobs that your favourite controller offers. In something like Ableton Live, where the Remote feature ‘captures’ your controller per track or device, being able to map one single knob to a parameter for the purposes of a carefully-controlled automation edit or a live performance tweak is handy. It is to me, anyway, and I primarly built this to cater for my own need :) The button is just there because a) there was enough space for it in the box and b) it’s handy for toggling that device (or another device) on/off; great for automation stutter edits with a glitchy effect, for example.

See it in use controlling an Ableton Live Auto Filter cutoff in the video above, while the push-button toggles the device on/off, and check out the pics, schematic and code to see how you can build your own.

Dev Process - Short Version

The first problems I ran into were in stabilising the value from the potentiometer (knob). For MIDI CC automation, you want the value to stay still and for the device to stop sending MIDI data when the knob isn’t being turned. Fortunately, my old friend and chipmusic compatriot Philip Cunningham (aka Firebrand Boy, aka unsymbol)

 had made a slightly more complex MIDI controller a few years ago so I was able to use some of his code (available on his Github) to take a running average of the input values and smooth them out. That wasn’t quite enough, though, and a bit more digging led me to the concept of power decoupling and the fact that a small capacitor would - for reasons I don’t quite understand because I’m an electronics noob - smooth everything out nicely. Phil’s code also clued me in on the Bounce stuff, which makes it much easier to get useful data from button presses. Cheers Phil!

I prototyped the whole thing on a breadboard (see below), testing the input with MIDI Monitor for OS X (MIDI-OX is best on Windows), and then packed it all into the smallest Hammond project box I could find in Maplin. The pot is a 100K linear (you can logarithmise the values in your code if you want to), the switch is the smallest I could find in Maplin (though Farnell/RS/etc probably have better ones; this one isn’t great, to be honest) and I used a Dremel to carve out the micro-USB slot and the knob/button holes. The £16 Teensy board sits on the case cover so that the screws are face-down when the device is in use, and I glued that down with a hot glue gun - bracing it at the back with a Dremelled-down piece of veroboard (also glued) so it can withstand having the USB cable jammed into it without moving. Hopefully the glue will keep it nicely in place, though a more hardwearing option might be to break out the micro-USB to a B-type connector mounted to the chassis. Easily done in a bigger case, but there is almost NO free space in this one once the components and wires are packed in. Finally I soldered everything in, tested it and was met with success!

If you make one of these yourself, bear in mind that loading an update of your code onto the Teensy (which you might need to do if you want to change CC mappings, for instance) requires you to press the reset button on the Teensy itself. I can do this quite easily by unscrewing the bottom of the box, opening it slightly, then poking a finger in to hit the button. Not ideal, but then you shouldn’t have to make changes very frequently. If you did, you could break out the rest switch to another physical switch mounted on the case. In the long term, I want to implement some SysEx control whereby you can send new mapping values direct from SysEx Librarian or something, or maybe a Max/MSP patch, which are stored in the Teensy’s tiny amount of non-volatile EPROM. Just a thought.

I’ll add other details as I think of them.

Note - you’ll need to install Arduino and the Teensy stuff for it (which is all part of Teensy setup, explained on its website), and before you send any MIDI-related code to the board you should go to Tools -> USB Type and select ‘MIDI’. Once the board is running in MIDI mode, you won’t be able to see any useful output in Arduino’s built-in serial monitor, but that’s no problem - just use MIDI Monitor or MIDI-OX instead. You can also change the self-declared USB MIDI device name in a header somewhere, but I can’t remember right now…I’ll add it when I do.

#include <Bounce.h>

//define how many pots are active up to number of available analog inputs

#define analogInputs 1

//make arrays for input values and lagged input values

int inputAnalog[analogInputs];

int iAlag[analogInputs];

//make array of cc values

int ccValue[analogInputs];

// index variable for loop

int i;

boolean resettingbutton = false;

int buttoncounter = 0;

Bounce button0 = Bounce(0,5);

int channel = 1;

void setup() {

  //MIDI rate


  pinMode(0, INPUT_PULLUP);


void loop() {


  if (button0.fallingEdge()) {

      usbMIDI.sendControlChange(30, 127, 1);


  if (button0.risingEdge()) {

      usbMIDI.sendControlChange(30, 0, 1);



  for (i=0;i<analogInputs;i++){

    // read current value at i-th input

    inputAnalog = analogRead(i);

    // if magnutude of diference is 8 or more...

    if (abs(inputAnalog - iAlag) > 7){

      // calc the CC value based on the raw value

      ccValue = inputAnalog/8;

      // send the MIDI

      //usbMIDI.sendControlChange(i, ccValue, 1);

      int inverted = map(ccValue, 127, 0, 0, 127);

      usbMIDI.sendControlChange(1, inverted, 1);

      // set raw reading to lagged array for next comparison

      iAlag = inputAnalog;


  delay(5); // limits MIDI messages to reasonable number


« Last Edit: February 11, 2015, 12:38:36 PM by Elantric »

Offline mbenigni

Re: Arduino MIDI Controllers
« Reply #1 on: May 07, 2013, 11:43:55 AM »
Oh, that's awesome.  I may want to install one of these chips in a volume pedal at some point.  $19 is very reasonable!
« Last Edit: February 11, 2015, 12:39:25 PM by Elantric »

Offline rolandvg99

  • Senior Member
  • ****
  • Posts: 1073
  • Total likes: 105
  • Rating: 49
  • Roland VG-99, my favourite therapist.
Re: Arduino MIDI Controllers
« Reply #2 on: May 07, 2013, 12:04:19 PM »
Very interesting and definitely something I must try to assemble (if my arthritis allows me).
« Last Edit: February 11, 2015, 12:39:34 PM by Elantric »
To V or not to V: That is the question.

My little Soundcloud corner

Offline DanVG

Re: Arduino MIDI Controllers
« Reply #3 on: May 07, 2013, 11:33:17 PM »
Send Midi codes with IR Remote Control is easy to implement on Arduino in addition of pots and switchs. (excuse my poor english).
« Last Edit: February 11, 2015, 12:39:53 PM by Elantric »

Offline DanVG

Re: Arduino MIDI Controllers
« Reply #4 on: October 24, 2014, 12:00:00 AM »
My cheap (# 12€) DIY Arduino MIDI IR-RC + 4 foot controller + EV-5 (with variable curve) and FS-6 jacks for GR-55 (PC, CC and some SYSEX).
« Last Edit: February 11, 2015, 12:40:02 PM by Elantric »

Offline whippinpost91850

Re: Arduino MIDI Controllers
« Reply #5 on: October 24, 2014, 08:12:39 AM »
Very cool, I love the wood switch pedals.
« Last Edit: February 11, 2015, 12:40:13 PM by Elantric »

Offline Elantric

Re: Arduino MIDI Controllers
« Reply #6 on: April 07, 2015, 10:56:54 AM »

Offline admsustainiac

Re: Arduino MIDI Controllers
« Reply #7 on: March 30, 2016, 10:48:13 AM »
Expanding Amplifire Switching

I have been gigging with the Atomic Amplifire for a few months now and am loving the great sounds and compactness for the smaller gigs where big pedal boards and tube amps take up too much space. I have been using all three foot switches on the Amplifire in A/B mode to give me quick access to 6 core sounds and using outboard delay and mod fx in the loop (as I need to be able to switch these for each preset).

I really wanted to expand the preset access and use more of the internal fx so have come up with a home-brew midi switching solution that can be built into a small pedalboard as shown in the pics below.
I used a cheap Arduino Nano board (£2 from china) and a few other components (about £20 in total - mostly for the footswitches) and wrote some simple software that I have put up on github:

So far I am pleased with the result as I now have access to 8 presets via the 4 A/B switches built into the board and for each preset am using the switches on the Amplifire for tap tempo and toggling fx and delay and this is pretty much what I need. I included midi control of the wah too but this is a bit 'steppy' (not sure if this is my software or the Amplifire but am working on it).

Anyway it's been a fun project and if anyone here is interested in having a go at this themselves I can provide more info.

Arduino MIDI Library v4.2
This library enables MIDI I/O communications on the Arduino serial ports. The purpose of this library is not to make a big synthesizer out of an Arduino board, the application remains yours. However, it will help you interfacing it with other MIDI devices.

Download the latest version here.


Compatible with all Arduino boards (and clones with an AVR processor).
Simple and fast way to send and receive every kind of MIDI message (including all System messages, SysEx, Clock, etc..).
OMNI input reading (read all channels).
Software Thru, with message filtering.
Callbacks to handle input messages more easily.
Last received message is saved until a new one arrives.
Configurable: overridable template-based settings.
Create more than one MIDI port for mergers/splitters applications.
Use any serial port, hardware or software.

Offline Elantric

Re: Arduino MIDI Controllers
« Reply #8 on: April 21, 2016, 01:03:01 AM »

This crazy tiny Arduino clone nestles into a AA battery slot
It's not as high-powered as a Raspberry Pi, but the AAduino is a tool many DIY types will find useful.

This crazy tiny Arduino clone nestles into a AA battery slot
It's not as high-powered as a Raspberry Pi, but the AAduino is a tool many DIY types will find useful.

aaduino comparison
Credit: Johan Kanflo
Ian Paul
Ian Paul | @ianpaul
Contributor, PCWorld Apr 20, 2016 8:52 AM
Make it smaller.

That’s what many DIY hackers cry out for when they see a new programming board. People even call for powerful mini-PCs like the Raspberry Pi 3 to shrink, as we saw in the reaction to our recent review. Well, get a load of this, makers: An Arduino clone that’s literally the size of a AA battery.

Sweden-based coder Johan Kanflo was looking for a way to make the Tiny328, which he was using in his DIY projects as an ISM radio node, more portable. Kanflo wanted a case for the Tiny328 with a battery compartment, but he couldn’t find anything that suited his needs. 3D printing wasn’t in the cards either.

aaduino boxed JOHAN KANFLO
That’s when he decided to go out on his own and shortly thereafter, the aptly named AAduino was born. This Arduino-compatible board fits neatly into a AA battery slot. Kanflo opted for this form factor to create a self-contained radio node that supplies its own power. In other words, he dropped the AArduino into one slot of a battery case with room for three AAs, and then put regular batteries in the others.

To take power from the batteries that are sharing the compartment Kanflo added Keystone battery terminals to the board, but with the poles reversed. He also had to file down some of the components without damaging them so they’d fit inside the battery compartment.

The board itself has an 8-bit ATmega328P micro controller running at 8 MHz, an RFM69C transceiver module for wide frequency communication, two temperature sensors, and an LED.

The impact on you at home: This is definitely not a Raspberry Pi replacement, but it is a nice little tool for any projects that require basic wireless communication between devices. If you’d like to create your own AAduino, Kanflo has posted all the information you need to get started on Github.
The AAduino
 2016-04-13  Johan  Arduino
I have been using Nathan Chantrell’s Tiny328 for quite some time as my swiss army knife ISM radio node. Now I wanted a more slim ISM node as my setup with a Tiny328 on a breadboard is not very “deployable”. I could of course 3D print a case for the Tiny328 but I have limited access to 3D printers and do not feel I have the time to explore that exciting part of the maker world just yet. This leaves me with finding off the shelf project boxes with a compartment for 2x AA batteries and the “radioduino” (and in an acceptable form factor). That search came up disappointingly, and surprisingly, short. I did have a set of standard eBay AA battery holders and looking at the 3x variant it occured to me. I needed to shrink the radio node, and the AAduino was born.

Honey, I shrunk the radioduino!
The AAduino is an wireless Arduino clone the size of an AA battery with Keystone battery terminals rotated 180° to act as positive and negative terminals. It is powered by an ATMega328p and is fitted with an RFM69C companion. There is room for two DS18B20 temperature sensors and an indicator LED.

I still think it looks a bit weird :)
It runs at 8Mhz to allow for greater life span since the CPU can run at a lower voltage. I have fused the 328 to brown out at 1.7V which is a bit out of spec at 8Mhz and slightly below what the RFM69C needs. Running at 4Mhz would be more suitable but I will see how well the node performs when the batteries are draining out.

AAduino, RFM69C side
Since the RFM69C is somewhat wider than an AA battery I used a file to make it slightly narrower. There is some room for that kind of modification without damaging the module. Next I clipped the legs of the DS18B20 until about 5mm remained and soldered it to the 3x pin header on the AAduino. I then drilled a hole in the battery box where the sensor can protrude and a small hole for the LED to shine through. The wire out of the battery box was cut, shorted and stuffed away inside the box.

AAduino inside 3xAA box
I use battery terminals from Keystone available from RS Components, positive and negative. There seems to be a cheap eBay alternative but I have not tested those. The + and – markings on the PCB indicates (this is important, read carefully) the positive and negative poles of the battery we are pretending the AAduino is. The Keystone spring contact should be soldered to the + marking and the button contact to the – marking. There is no protection diode here so be careful. Also note! If you want to power the AAduino from a bench power supply, connect the power supply’s black negative lead to the + marking and the red positive lead to the – marking.

The 3xAA boxes are also from eBay and there seem to be two different types. One that is really good and one that is really crappy. I will let you in on the secret of buying the correct one. The good ones have a nice build quality and plastics and look like this. Note the rectangular piece of plastic below the battery compartment extending from side to side.

Good 3xAA holder
Looking at the crappy ones, well you can tell can’t you? In the top left corner it seems someone used a soldering iron on the poor thing. The lid does not snap in place very well and the plastics is really cheap.

Crappy 3xAA holder

Offline admsustainiac

Re: Arduino MIDI Controllers
« Reply #9 on: April 04, 2017, 03:42:45 PM »

Offline Elantric

Re: Arduino MIDI Controllers
« Reply #10 on: April 11, 2017, 11:38:17 PM »


Arduino Team — October 17th, 2016

If guitar effects pedals aren’t really your thing, perhaps Evan Kale’s touchless MIDI controller will fit the bill.

Using an Arduino, along with a Colpitts oscillator and some other electronics, Kale has come up with a rather unique interface for his guitar. Instead of using a foot pedal, he put a strip of aluminum foil inside of a fingerless glove, then attached a homemade metal detector coil and circuit to the back.

This allows him to strum the guitar, then change the sound by moving his hand away and toward the strings as a MIDI input. Very clever, and as always, Kale outlines everything in his own zany video style!

You can find the code for this project here and check out the schematic on Imgur. On the other hand, if this looks slightly familiar, he uses the same type of circuit for this MIDI controller as the metal detector previously covered on our blog.

« Last Edit: April 11, 2017, 11:52:42 PM by Elantric »

Offline DanVG

Re: Arduino MIDI Controllers
« Reply #11 on: April 22, 2017, 01:44:14 AM »
Another controler with Arduino Nano for my Cubase

Offline Ed_Saxman

Re: Arduino MIDI Controllers
« Reply #12 on: April 22, 2017, 10:22:45 AM »
Looks great, Dan! Love the arcade buttons and the pots style.

Offline gumtown

Re: Arduino MIDI Controllers
« Reply #13 on: April 22, 2017, 03:54:13 PM »
Here is one I made as a parameter knob box for controlling the GR-55, GT-100, GP-10 and others.
It uses regular potentiometers so has no control feedback from the device.

I then started on a rotary encoder version, which is capable of reading back device settings,
but this one was not completed as I couldn't get the Arduino Teensy to read all the encoders at the same time properly.

Project source code here
« Last Edit: April 22, 2017, 07:12:25 PM by gumtown »
Free "GR-55 FloorBoard" editor software from

Offline sixeight

Re: Arduino MIDI Controllers
« Reply #14 on: April 23, 2017, 01:25:18 AM »
I then started on a rotary encoder version, which is capable of reading back device settings,but this one was not completed as I couldn't get the Arduino Teensy to read all the encoders at the same time properly.

There are faster Teensies now, the 3.5 and 3.6. Using one of those together with interrupts should work. They also have more pins.

Offline Elantric

Re: Arduino MIDI Controllers
« Reply #15 on: November 07, 2017, 02:21:52 PM »

« Last Edit: November 07, 2017, 02:34:50 PM by Elantric »