Sunday, 22 May 2016

EHX Pitch Fork Remote Control

The EHX Pitch Fork is a very compact and flexible pitch shifter, and I use it in various ways with Zaardvark: octave up/down/both, 50% wet/dry blend. 100% wet, sometimes latching footswitch, sometimes momentary. The number of different permutations gives me a headache during gigs. I have to follow the notes on my setlist very carefully and it always seems to take too long.

What I need is to be able to store settings with patches in my pedalboard controller and have them applied automatically when I change patches, just as they are for the Moogerfoogers.

Fortunately, none of the controls are in the audio signal path - they just provide inputs to the processor. The Blend and Shift pots divide the 3.3V to produce analogue levels that the micro can read. The Latch button connects or disconnects a pullup to a digital input, and the 3-way octave switch connects a digital input to 0V, a 55Hz square wave or 3.3V.

I thought it should be possible to drive the Blend and Shift processor inputs from DAC outputs (with the pot wipers disconnected) and use some analogue switches in parallel with the latch and octave switches. I also wanted to be able to 'press' the footswitch from the pedalboard controller as a bonus feature (allowing the Pitch Fork to be turned on when the signal envelope crosses a threshold, for example). I didn't want to make the pedal unusable in the normal manual mode, so the original pots and switches needed to be left on and continue to work.


This is the final schematic:

The processor is an ATmega328p, as used in many Arduinos. It will receive MIDI messages from the controller and set the DAC and switches to match the requested settings. The dual DAC generates the 0-3.3V levels for blend and shift. A quad SPST switch handles latch, octave and footswitch. A dual SPDT switch is used to choose whether the blend and shift values are driven by the original pots or the DAC outputs.

There's a handy space inside the Pitch Fork box for a battery. I never use it and it should be big enough for a small PCB using surface mount components. This is the layout:

A 1/4" jack socket is the blend CV input. It is also used to mount the PCB to the box. On the other side is a 1/8" TRS socket for the MIDI input, which is just the ATmega's 3.3V level USART. The 6-way header is for reprogramming the firmware. The 10-way connector carries the Pitch Fork PCB signals.

The PCB was made by Ragworm:

It fits nicely:


The end result:

I made a few mistakes in the design, hence the mods. I forgot to update the schematic when I found during prototyping that the DAC CS signal could not just be held low. I also overlooked the DAC output minimum load spec. Without the resistors the outputs tended to oscillate when connected to the Pitch Fork. The resistor on the bottom side is a stronger pullup for the MIDI in. The ATmega's internal pullup was not strong enough.

Putting it all together:
Final assembly:


The firmware is written in C++ using the Arduino platform, built in Xcode with the embedXcode tools and downloaded to the target using USBasp and the 6-pin header.

Each control is represented by a class that registers interest in specific MIDI messages, and knows what to do with them when they are received by the MIDI class that polls the serial port. The main program (.ino file, in Arduino terms) just instantiates each of the classes and calls their setup() and loop() methods:

The pedalboard controller firmware was also updated with a PitchFork class that supports a new set of messages from the iPad and translates them to the MIDI messages for the Pitch Fork itself.

User Interface

The MIDI Designer-based iPad interface (described in this blog post) now has a new page:

Each of the controls has an associated local/remote toggle. The blend can be controlled by the Pitch Fork's blend pot (local), MIDI or the CV input.

Here's a rather scratchy demo using a simple loop. It shows how the Pitch Fork controls can be operated from the iPad or the pedal itself, depending on the local/remote setting. The box with the 4-digit display at the top left is the pedalboard controller. The iPad connects to this via its MIDI Bluetooth interface and it translates the MIDI messages received from the iPad into Pitch Fork MIDI, which it transmits to the pedal.

This one shows Pitch Fork settings being restored by the controller when the patch is changed:

It seems to work exactly as intended and has allowed me to remove the Pitch Fork instructions from my setlist altogether.

Sunday, 26 April 2015

Dual Freeze

I've had a Freeze pedal on my board for a while, and decided it was time for another. On top of that, I've got a Pitch Fork that I'd like to get on the board as well. So the plan was to put the guts of two Freeze pedals into one enclosure that fits into some spare space on the board, and replace the existing Freeze with the Pitch Fork.

It doesn't need footswitches - the controller has two opto-isolated outputs for that. I only ever use it in 'fast' mode, so I don't need the switch either.

I started by removing the sockets, switch, pot and LED from the PCBs:

The box in the middle is a Hammond 1590BSBK - a deeper version of the standard enclosure that should accommodate two PCBs.

Some planning:

Some drilling and filing:

Some wiring:

The output of the first Freeze and the input of the second go to sockets so that the Pitch Fork can be put between them in the chain.


And on the board:

Monday, 2 March 2015

Pedalboard Controller MK2 Software

The last post described the hardware design and building of this:

This post describes the main features and the iPad app screens used to program patches.

For some context, here it is on the pedalboard:

Clockwise from top left: CV MK2, power supply, switch box, KOMA BD101, Ditto Looper, EHX Freeze, Moogerfooger Freq Box, Moog EP-2 expression pedal, 3-footswitch strip, Moogerfooger Low Pass Filter, Moogerfooger Ring Mod.

The 5V CV outputs are connected to the Moogerfoogers through TRS cables. The 9V CVs get to the KOMA through an Ethernet cable, broken out to TRS cables on a small board screwed to the pedal. This also connects the KOMA's sensor input to the CV box. The Freeze is controlled by one of the opto-isolated outputs connected via a stereo mini-jack cable (it has a spare opto output for future use). The expression pedal connects via its normal TRS cable. The 3-footswitch strip goes via an Ethernet cable, with the switches and LEDs wired separately (the CV box controls the LEDs, not the footswitches directly).

First, a bit about the overall design...

The idea is to have a variety of 'sources' that can be assigned to the CV outputs. This is the list so far:
  • Fixed level
  • Noise
  • LFO (sine)
  • Expression
  • Low Pass Filter envelope
  • Ramp
  • Arbitrary waveform
  • Bus combining other sources
The CV outputs can be connected individually to any of the sources, and their output level ranges can be set, and optionally inverted. For example, CV output 1 could deliver a sine wave from an LFO in the range 3V-4V. Or the expression pedal could change multiple parameters at the same time, perhaps in the opposite direction.

The sources all have their own set of configurable parameters, e.g. the LFO frequency, ramp time etc., and all are triggerable by a footswitch.

A patch is defined as the set of CV/source assignments and their parameter settings.

All of these features are implemented in the Arduino firmware (mostly C++), with the parameters and source routing being configurable through MIDI Control Change messages. These can be received from the iPad app and saved into the permanent storage attached to the Arduino.


iPad App


MIDI Designer is an app that can be used to build custom interfaces for MIDI control. You can place buttons, knobs, sliders etc. and have them send MIDI messages when they are changed. These are organised into pages taking up half of the screen.


5V CV Outputs


The page on the left is for selecting the source for each 5V CV output. The right is used to set the output voltage range. Sources with variable output (most of them) operate between the low and high levels, but each of these also has its own minimum and maximum value, so that it can be further modified by a different source, selected by the knobs. The 9V CVs have similar pages:


LFOs and Noise Sources


The left-hand page has the controls for two LFOs and two noise sources. The frequency range and Min control can be used to set the source to a fixed frequency. But the Control knob allows any other source to vary the frequency between Min and Max. In the screenshot, the expression pedal is used for that. The Trigger knob selects which of 8 programmable triggers starts the LFO running, or 'On' for a free-running oscillator. More on the triggers later.

The Noise source Rate control determines the time between new random values. The Amplitude control changes the amount by which the noise value can change at each step. This can be used to create wildy varying values or more subtle changes. Both Rate and Amplitude can be controlled between two values by any of the other sources.

The right-hand page is for configuring the triggers. This allows the footswitches to be used in momentary or latched mode (level or edge). The Env option can be used to generate a trigger when the audio signal exceeds a threshold. This could be used to trigger the Freeze pedal, for example.


Misc. Sources and Arbitrary Waveform Generators


The expression inputs can be inverted and enabled by a trigger. Expr 1 is the EP-2 expression pedal. Expr 2 is the KOMA's sensor output.

The Envelope State controls allow the levels and sensitivity of the Env trigger to be set.

There are two ramp sources with controllable rise/fall time.

The LPF's envelope output can be enabled or disabled, and boosted up to x3.

The Freeze settings determine which of the triggers controls the Freeze pedal(s).

The footswitch strip LED states are driven by selectable triggers.

Tempo is an experimental feature. In future, some things might need to be driven by a signal derived from a tempo - either a fixed BPM or tapped.

The Arbitrary Waveform Generator (AWG) has 8 'phases' that are run in turn. Each phase has a target level (the upper slider) and the time to reach that level from the previous one. This allows triangle, square, sawtooth waveforms to be created, and many other kinds of weird waveshapes. The overall rate can be fixed or controlled by another source.


Buses and Patch Control


The Bus 'sources' allow an output to be driven by a combination of two sources, with the balance between them being fixed or controlled by another source. For example, the expression pedal can be used to gradually change an output from an LFO to a noise source.

The page on the right has the buttons used to create and save patches in the Arduino. The other controls are mostly just useful during firmware development.


What Next?


I should really record some demos of the different features. Maybe one day.

The next addition is going to be a drum trigger. This will make use of a spare input connected to some kind of trigger attached to a tom. It'll be able to trigger any of the features in the box. For example, to 'duck' the guitar rhythmically, or start a ramp, or hit the Freeze pedal. Loads of possibilities.

Saturday, 26 April 2014

Pedalboard Controller MK2

A few years ago I built an Arduino-based gadget with two CV outputs, a footswitch and an output for controlling an EHX Freeze pedal:

I wrote patches with oscillating or random CVs and used them to drive my Moogerfooger MF-101 Low Pass Filter. Now that I've got three 'foogers and a CV-controllable KOMA BD101 delay, it's time for an upgrade.

MK2 has a lot more features:
  • Eight 5V CV outputs for Moogerfoogers
  • Six 9V CV outputs for the KOMA delay
  • CV input from the KOMA sensor
  • Six opto-isolated outputs for the Freeze, tap-tempo and (maybe) looper control
  • MIDI support - for patch development and live control
  • Expression pedal input
  • CV input for Moogerfooger LPF envelope
  • Three footswitches with LEDs
  • Based on the much faster Arduino Due
There's not much free space on the pedalboard so it's all got to fit into a box the same size as the original. After several attempts, I settled on this design:

The Arduino is mounted vertically at the back of the box, with a shield PCB sitting on top of it. A ribbon cable connects the shield to another PCB that lies just below the upper surface, with a 4-digit, 7-segment display, up/down patch select switches and four RJ45 sockets at the front. Two more Veroboard PCBs with TRS connectors mount on the front panel and connect to the shield through PCB header/crimp connectors. The shield schematic looks like this:

The main elements are the CV DACs (5V SPI with level shifting for the Due), 9V gain stage, opto-isolators, 7-segment display drivers and an I2C EEPROM for non-volatile patch storage. The PCB:

The display/RJ45 board is mostly routing signals from the shield, so the schematic isn't very interesting. The PCB looks like this:

The PCBs were made on an LPKF C40:

I built the easy one first:

Then the shield:

Fitting the display PCB into the box:

I built the TRS Veroboards and fitted them into the box:

Wired the CV board to the PCB header that plugs into the shield:

The whole lot assembled:

One of the RJ45s brings out a 3.3V serial port from the Arduino. So I needed an external board to translate to MIDI:

The next phase of the project is to write the Arduino firmware and find or write an application to configure the patches from a laptop or iPad. It'll be a while before the original box is replaced on the pedalboard...