Making Connections: Building a USB Footswitch
The concept is simple: replace a few of the keys on a USB keypad with heavy duty footswitches. Then use the select function in Max to direct these switches to control your patch.
Disclaimer: This tutorial assumes basic familiarity with electronics and the use of soldering tools. Cycling '74 assumes no responsibility for damages to your keypad or any other device in following this tutorial.
As a guitarist, I was looking for a simple hands-free controller for Max. Rather than buy an expensive pedalboard and MIDI interface, I decided to build a simple USB footswitch. It’s ridiculously easy to make and costs less than fifty bucks.
Here are the parts you will need:
- USB keypad (a keyboard can work too, but is slightly more difficult to wire up---more non-ASCII key functions)
- momentary on switches (you will find these labeled “off-(on)”)
- fine wire
- a box (I used a project box from the local electronics shop)
and the tools:
- a soldering iron and solder
- a small screwdriver
- wire strippers
Download the Max 4.6 legacy patch and the updated Max 5 patch used in the tutorial.
First open the USB keypad. Each brand is designed a little differently, but most of them are held together with tiny screws. Some brands hide these under rubber feet or stickers. Don’t worry if you have to crack the plastic shell (it gets discarded), just be careful not to damage the circuit board itself.
Inside the enclosure, you will find a folded plastic sheet with wiring embedded in it. The keys press against this to complete a circuit. This sheet is connected to a terminal on the circuit board. Gently remove it from the terminal.
Trace the circuit on the plastic sheet to figure to see which two leads produce a desired character. Since this is a matrix, each lead is used for multiple characters so jumpers may be required. If you don’t particularly care which characters the buttons produce (we are, after all, going to be using select to filter this input data) you can skip this step. Just check each pair before you solder to make sure you don’t get results outside of the standard ASCII codes (i.e. num lock or “000”). If you want to specify the character output of each button, simply trace the circuit on the plastic sheet
Solder wires onto the terminal. There isn’t a lot of space, so you’ll probably want to use some fairly fine wire. To keep things neat, I used an old printer ribbon cable.
Drill holes in the box and mount the switches. Make sure to tighten them all the way. Then connect the wires, but don’t solder them just yet.
Run the test patch. As you press each button, its ASCII number will be displayed in the number box. Once you verify the ASCII numbers for each button, input these values as arguments to the select operator. In this example patch I ran each outlet of the select operator to an oversized bang as a simple display.
Once you have verified that the desired characters are produced, solder wires to the buttons.
Essentially this is just a cheap and easy way to connect momentary switches to your computer via USB. This same principle can be used with other types of momentary switches---percussion triggers, tilt switches or even some types of light sensors. Non-momentary switches can be used too; they will output continuous streams of repeated keystrokes. Use the change operator if you want to make these switches behave like momentary switches.
This same footswitch could also be built using a wireless keypad. How could this change the usability of the footswitch?
If you wire one of the switches to num lock, you can in effect double the number of keystrokes available to you while using the same number of switches. If you plan to do this, you may want to use a keypad that has an LED num lock indicator. If it is difficult to mount the circuit board in such a way that the LED is visible on the footswitch, consider replacing the LED with one with longer leads.
by Andrew Benson on
Oct 16, 2007 3:05 PM