Saturday, August 2, 2014

Virtual Whammy Bar Part 1


Project Abstract
So I already have an effect pedal that can do the trick, what's the problem? Well maybe I want to use my hand to control the whammy function for a more natural feel as opposed to my foot on a pedal. And again in my case, I would also like to keep the expression pedal available for functions like volume and wah. With modern music equipment we do have an option: MIDI. Both my GT-8 and the Digitech Whammy provide MIDI (Musical Instrument Digital Interface) inputs for external control over the effects.
MIDI is a simple serial protocol (think PS/2, I2C, anything using RS-232, etc) that has been around since the early 80's for the real-time communication of musical information. For instance, if you hit a middle C on a MIDI keyboard, it will send a message to a synthesizer to play a note (a "Note On" command), what note (middle C in this case), and how hard you hit the key (referred to as "Velocity"). The synthesizer in turn takes this info and creates audio output based on its current instrument patch, such as piano or strings. Releasing the note on the keyboard then sends a similar command, but with a "Note Off" command instead.

Command ByteData Byte 1Data Byte 2
100100000011110000111111
Note On CommandMidi Channel = 0Note = 0x3C = 60, Middle C on a pianoVelocity = 0x3F = 63, about half volume

Shown above is the actual MIDI message to play a middle C. You can see that the first byte contains a four bit command and a four bit channel assignment. Logically we can see that there are 16 possible commands and 16 possible channels. The channels represent devices in the MIDI chain. An example could be a situation where you have one or more synthesizers each capable of playing several instruments at a time. The first synth might have a guitar, bass, and keyboard assigned to channels 0, 1, and 2. Now you can add a drum machine to the chain which responds to messages on channel 10, and then a reverb unit on channel 12 and so on. Depending on the command, the data bytes will have different meanings. These data values can range from 0x0 to 0x7F (0 to 127 in decimal). I'm not going to thoroughly explain MIDI here, more information can be obtained from MIDI.org.
The goal of this project will be to turn hand motions into MIDI messages that an effect pedal will respond to.