Therefor, I've been considering a way of hacking existing hardware to implement this feature. I settled on the Ditto looper for this experiment because I would need two identical loopers and I already have one Ditto, which reduced my project cost.
My strategy involved two parts: I would first hack the Ditto to gain CV control over its footswitch and then code a microprocessor to translate MIDI commands into appropriate voltages to control the looper.
Ditto CV ModThe first step was rather straightfoward. After considering a few options, I decieded to replace the footswitch with a mini-jack soldered to the LED side of an opto-isolator. The transitor side of the opto-isolator was soldered directly to the ground and to the appropriate pin of the tactswitch on the Ditto PCB. Sending 5V to the mini-jack makes the pedal respond exactly as it would if its footswitch were pressed.
This modification made for very interesting interaction with my modular synthesizer.
MIDI to CV Conversion
Port registers allow for lower-level and faster manipulation of the i/o pins of the microcontroller on an Arduino board. The chips used on the Arduino board (the ATmega8 and ATmega168) have three ports:For instance, assigning the binary number 00000011 to the variable PORTB will set pins 8 and 9 high (5 volts) at the exact same time. I decided to use MIDI CC commands to control the loopers with a bit of logic. Have a look at the truth table for exclusive or (XOR):
- B (digital pin 8 to 13)
- C (analog input pins)
Each port is controlled by three registers, which are also defined variables in the arduino language. The DDR register, determines whether the pin is an INPUT or OUTPUT. The PORT register controls whether the pin is HIGH or LOW, and the PIN register reads the state of INPUT pins set to input with pinMode().
- D (digital pins 0 to 7)
Returning to our MIDI CC, I control my loopers according to this scheme:
- MIDI CC value of 1 controls the first looper
- MIDI CC value of 2 controls the second looper
- MIDI CC value of 3 controls both loopers
- 1 = 00000001
- 2 = 00000010
- 3 = 00000011
PORTB = PORTB ^ ccValueThis worked like a charm, but I also wanted to sync execution of these commands to a MIDI clock. I solved this problem by pushing the received MIDI CC values into a FIFO buffer and counting the MIDI clock ticks to a certain number before popping values and sending them to PORTB as described above. The number of ticks to count depends on the note value to sync to. For instance, as there are 24 ticks per beat, to sync to sixteenth notes you need to count 6 ticks between function calls.