Building MIDI controllers is something I’ve spent a lot of time doing lately. As the user of an increasingly complicated computer-based music setup, involving processing a guitar signal and software synthesizers, currently based in Sensomusic Usine Hollyhock, there seems to be no limit to the number of parameters I want to control, or the number of things I want to be able to switch on and off.
So for my latest foot controller, I decided to make it as fully-featured as possible:
- Compact and foldable USB MIDI foot controller
- 36 metal footswitches
- RGB LEDs for most of the switches – which respond to MIDI data coming back from the connected computer
- A 6-character alphanumeric display, for selecting and displaying the names of presets
- Connectivity with two external expression pedals
- One of the footswitches is a “bank select” switch, so if I run out of switches to assign functions to, I can simply switch to the next bank
- Large LEDs on the left to indicate the recording / playing status of Mobius – a software loop pedal
- All LEDs flash white to the tempo of whatever loop I’ve created in Mobius, and a headphone jack plays a metronome-style click – to keep my (hypothetical) drummer in time with the loop
I regret not taking more photos while I was constructing this – as you can hopefully see, it’s made from a lot of pieces of wood cut to size and with holes in carefully worked out places.
The central component in this foot controller is a Teensy++ 2.0 microcontroller. Teensies are an excellent choice for building MIDI controllers. They are compatible with Arduino – probably the most popularised and easy-for-beginners microcontroller – but unlike Arduinos, Teensies can appear to your computer as a MIDI device when connected by USB – exactly what we want here. They arguably also have better specs, especially for the price. (If you’re super-new to microcontrollers, a microcontroller is a “computer” on a tiny chip / circuit board, which will execute computer code which you write and upload to it – code which defines how it will interact with its connected components, like LEDs and switches.)
LEDs and switches
I can’t really give a good functional reason as to why I chose to use RGB LEDs rather than a single colour. The idea of being able to choose later, via software, what colour each separate one should be, and to have an eye-catching, multi-colour artifact, just seemed too alluring, even though the extra wiring involved added a few hours onto the project.
The LEDs and switches are connected in an “array” – a configuration which allows for many more LEDs and switches to be connected to the microcontroller than it has individual pins. In the configuration I’ve used, the LED and switch arrays share “ground”, or “column” as I’ve labelled them below, pins between the two arrays – an “original” method which I can’t find any other documentation on anywhere on the web. It works great, and saves a bunch of wiring.
This two-in-one array has 9 “column” connections to the microcontroller, 12 “row” LED connections (to write to all of the red, green and blue pins of 4 LEDs at the same time), and 4 “row” switch connections. I’ve used the words “row” and “column” here because the most common physical appearance of an LED or switch array is as a grid with rows and columns, so these concepts should be familiar to those who have worked with LED or switch arrays before. I’m not referring to the physical arrangement of the LEDs and switches in my foot-controller – in fact, the way I’ve configured it, a “row” refers to one of the four panels of the foot-controller, and a “column” refers to one of the 9 “positions” that a switch / LED may take on any one of these four panels.
Because of the amount of current required to return into each “column” connection (the “row” connections don’t need to handle as much current in one go), each of the 9 “column” connections has to be buffered with a 2n2222 transistor. This allows all of the LEDs to be lit brightly enough.
The above schematic shows a bare-bones representation of this configuration – with just 4 single-colour LEDs and 4 switches (2 rows, 2 columns). In terms of Arduino / Teensy code to drive this configuration, you activate a “column” by making its “column” pin HIGH (not LOW as you might be used to, because the added transistor reverses the effect). Once a “column” is activated, you then switch on whichever of its LEDs you wish to by making the corresponding LED “row” pin HIGH, and you may also read either of the column’s switches by doing a digitalRead on the appropriate switch “row” pin, which you will have initially set up as an “INPUT_PULLUP” pin. The digitalRead will return HIGH/TRUE if the switch is “open”, and LOW/FALSE if “closed”.
If you want more LEDs and switches, simply add columns and rows as required. For RGB LEDs, you’ll simply need 3 row-pins per “row” of LEDs.
Ideally, I should have actually added a diode in series with each switch. As a result of not having done so, pressing two switches simultaneously causes undesirable behaviour from the LEDs on the affected columns, and if I were to press three or more switches simultaneously, the microcontroller could “detect” additional switch-presses which aren’t really happening. That’s something I’d change next time – but for now, I usually only press one switch at a time anyway.
Two inputs at the back allow for the connection of expression pedals, and this data is sent to the computer as 14-bit MIDI CC commands (although the Teensy++ 2.0 only actually reads the pedals in 10-bit). I recommend getting a Daphon DF2210 off Ebay (it’s the cheapest Wah pedal out there) and modifying it to be an external expression pedal – they are very well suited to this. I may write another post about this in the future.
In its simplest form, this foot-controller is for switching individual guitar effects on and off. I use Sensomusic Usine Hollyhock as a live audio processing solution, hosting numerous effects, and being able to switch them on and off in the traditional foot-controlled way is essential.
Building on this functionality, the LEDs on the foot-controller don’t just light as a direct result of pressing a switch – instead, pressing a switch sends a MIDI command to the computer, the computer then switches the relevant effect on, and then sends a MIDI command back to the foot-controller saying that it’s been switched on, and the foot-controller then lights the LED to communicate this to the user. The advantage of doing it this way is that if I do something like change what preset I’m using on the computer, the computer can then tell the foot-controller what effects are now on or off, and the LEDs on the foot-controller update accordingly.
UPDATE: Since originally writing this post, I’ve discovered that Usine natively supports this kind of two-way communication with switches / LEDs, which is great news. Previously, I’d created complex scripts / patches in Usine and Bidule to implement this functionality.
Looping with Mobius
If you like loop pedals and are interested enough in computer-based live music to be reading this post, you should check out Mobius by Circular Labs. It has all the functions of a traditional loop pedal, plus a whole lot of extras (changing the loop speed or pitch, duplicating it so it’s twice as long, reversing, having multiple tracks…) – it’s so customisable in fact that it even has its own scripting language. It can be controlled by a MIDI foot-controller, so can behave very much like a loop pedal does.
Ideally you’ll also want some visual feedback of what’s going on with your looper though, and so I built into this foot-controller two large LEDs at the far left end – a red one to indicate “recording”, and a green one for “playing”. They’ll both light at the same time when I’m overdubbing. As far as the foot-controller is concerned, these LEDs respond to MIDI commands coming in from the computer / software, just like all the other LEDs. In order to get Mobius to send the correct commands to control the LEDs, I had to write scripts using its scripting language.
Many hardware loop pedals have an LED which flashes to the tempo of a loop the user has created – a great feature for keeping in time with a loop if you can’t quite hear it clearly enough. My foot-controller does the same – while a loop is playing, every LED flashes white to the tempo. Mobius makes this easy – if configured correctly, any time a loop is playing, it will continuously output MIDI “clock” commands to indicate the tempo. If these are routed correctly, the foot-controller will receive these commands and flash the LEDs accordingly.
Taking things a step further still, I added a headphone jack to output a metronome-style “click”, to easily enable a drummer or anyone to keep in time with a playing loop. A volume pot is discretely accessible with a screwdriver, hiding down one of the holes beside the switches and LEDs. A couple of resistors and capacitors were needed for this circuit too. If only we’d had such a tool available in my old band, where in order to attain headphone “clicks” we instead came up with an Arduino-based solution involving blu-tacking a light-sensor onto a hardware loop pedal’s tempo-flash LED!
Alphanumeric display, and advanced interfacing with Usine
The alphanumeric display also shares 6 of the 9 “column” connections for the LED / switch array (see above), then has an additional 15 “row” connections from the microcontroller to control all 15 possible display-segments of a character of text.
Usine is an exceptional piece of audio software. Not only will it let you patch audio and MIDI between plugins in any configuration imaginable, you can do the same for every parameter of a plugin or softsynth. You can even patch “arrays” of data between modules. And on top of all that, you can even create your own modules easily by programming in Pascal, allowing for advanced customised functionality.
This will have to await a full explanation in a future post, but by creating some very custom scripts within Usine to allow two-way communication with the foot-controller, the foot-controller may be used to load or save a “preset” of plugin settings in Usine, selected by the preset’s name which is viewable on the foot-conroller’s alphanumeric display. The resulting system behaves a lot like a multi-fx pedal, but hugely more customisable and not only limited to guitar.
Feel free to message me if you’d like a copy of the source (Arduino / Teensy) code. It’s still a bit messy since I’ve developed it in quite a hurry, and hopefully I’ll eventually make it public on this page after it’s been refined some more.