I have an Audio Effects Processor for my guitar which allows you to control it using midi messages. I thought this would be a great use for the Arduino based on other people's success sending other types of midi messages. This controller should work with any effects processor which allows you to control it using midi.
The foot controller I decided to house the project in has five foot pedals. Each one of the pedals is a normal-open momentary switch. These switches connect the digital pins to ground. The pins are set to use the internal pull-up resistor which is why we set the initial state of the switches to HIGH in setup().
I don't care what the built in spell check says, that's how I spell favourite
Each switch also has a corresponding led. The led is used as a visual indicator for the switch activity or state.
The midi messages are sent out via the built-in midi jack.
My implementation of this idea, and pedal selection, is only one of many possible configurations. The code can easily be changed to two other options I considered, or any combination you want.
Option 1 - Five Favourite Buttons
Option 2 - Pedal 1 cycles between groups of 4 different Favourite buttons.
You could also use different hardware. The Arduino has a lot more digital connectors. I plan on interfacing analog controllers to send other types of Control Change messages. You are only limited by your processor and hardware choices.
I use delay() calls to do a software debounce for the switches. I flash the led corresponding to the switch during this delay for a visual confirmation. This delay reduces, and so far as I can tell, eliminates multiple midi messages being sent. This does restrict the speed a little bit though, compared to a commercial foot controller.
In the loop() I use a for loop to poll the switches for changes. Then a case statement sends the midi message corresponding to the pedal pushed.
The Program Change messages used should work for any Effects Processor. I use midi channel one in the code to transmit the messages on. Make sure your Effects Processor is on the same channel or is set to omni mode. I use the midiProg function to send the Program Change messages.
midiProg( 0xC0, n );
0xC0 sends a program change message on channel one as the status byte.
n is the program number to change to. It is an integer, and on my controller goes from 0 to 99.
The Bypass Mode switch toggles the internal bypass in my Effects Processor. This midi message may be specific to my processor. I have not tried this message on any other processors, it may work, you may just have to change the message being sent. I use the midiSend function to send the Bypass Message.
midiSend( 0xB0, 0x5B, x );
0xB0 sends a Control Change message as the status byte. 0x5B sends All Bypass as the first data byte. Again, this may be specific to my processor. x is the second data byte, 0x00 for off or 0x7F for on.
I put the code on another page to keep the formatting easier to read. There are some long lines in the code that spread everything out too wide.
Sketch Code for the Effects Processor Controller
I'm jamming this weekend so I will report back soon on how it handles the real world. It seems to be working better than expected so far in my preliminary testing. I will also have some pictures of to internals up shortly.