Sep 18, 2012

The time since the last post was greater than usual because I took a trip to New York to play a show with my band Samantha, and because I was waiting for some Sanwa arcade buttons to show up in the mail from Hong Kong. The Sanwa OBSN-24 buttons will be used for one-shot effects, and as momentary switches for Beat Repeat plugins to simulate a Novation Dicer. Now, a post briefly describing the code used to read the potentiometers.

As described in previous posts, this device uses a Teensy++ development board. The Teensy is compatible with the Arduino development environment, making it easy to code for after a bit of reading and experimentation. The board interfaces with and is powered by a computer via USB. The Teensy++ was chosen over a native Arduino board because it is smaller and has more pins.

The Teensy++ has a variety of pins with different capabilities. Each of these pins allow signal to be input or output to the board. Simply put, the microcontroller reads data from the pins, uses the code to interpret it, and does something. For the majority of this MIDI controller, this will be analog signals from potentiometers, or “knobs.”

A potentiometer is a resistor that allows output voltage to be adjusted. This varied output voltage is the signal that will be sent to the Teensy++ to eventually control a MIDI parameter, like a filter cutoff effect for example. This picture displays three types of controls used in this device. From left to right, slide potentiometer (fader), rotary encoder, potentiometer.

On the potentiometer, there are 4 pins. From left to right, voltage, signal (or “wiper”), ground, dummy. When the knob is turned, the voltage output through the wiper is varied. The fader is similar, except that the method of actuation is different. Instead of twisting a knob, the blade is moved along a track, which adjusts the voltage output.

The next post will describe a simple project to read the value from a potentiometer, and translate it to MIDI.