Recently I’ve been working on a four second digital delay with tap tempo and delay trails. There are lots of digital delay projects already, but the vast majority of them are based on the PT2399, which limits both the length of the delay and the sound quality.
A quick summary of the features:
- 0 → 4 Seconds of digital delay
- 12 bit/32KHz input, 16 bit/32KHz output
- Delay trails (tails) on/off
- Clickless effect in/out bypass switching
- Momentary/latching feature on bypass switch for “echo splashes”
- Tap tempo
- Tempo LED to indicate echo rate
- Dry audio path is entirely analog
- Delay Time, Repeats, and Delay Level controls
- High and Low tone filter controls
This project is based on the dsPIC 33FJ64GP802 chip, with a couple of 23LC1024 1Mbit/128KB serial RAM chips for the storage. The dsPIC includes a 12-bit ADC and a 16-bit DAC on-chip. The initial sampling is done at 12-bit resolution and 32KHz, but after that, all the internal processing is 16-bit, and the final output is actually 16-bit/32KHz. 12-bit/32KHz is a typical specification for a rackmount studio delay processor of the 1980’s. The sound quality is very good, without being super-clean or sterile. It certainly beats the PT2399 hands down, and it doesn’t suffer from worse and worse quality as the delays get longer either.
The worst (only) problem is background hiss. The dsPIC’s on-chip DAC seems to produce about 10mV of noise. Some of this is removed by the post-DAC filtering, but about 5mV remains. This is pretty noisy by modern standards. For guitars-level signals, modifying four resistor values improves the S/N ratio significantly. This is described below.
As you can see in the guts photo at the bottom of the page, all the parts are DIY-friendly through-hole DIP ICs. This isn’t easy to achieve for something like this, since virtually all DACs and RAMs are surface-mount these days. I’ve managed to keep it to six ICs, and apart from the 28-pin dsPIC, they’re all little 8-pin DIPs, so the project is able to fit in a reasonably sized enclosure. The PCB is designed for a Hammond 1590BB or equivalent.
The current firmware has five controls. Three are the standard delay controls: Delay time, Repeats, and Delay level. The other two are high and low shelving tone controls for the delay signal, so you can sculpt the sound of the repeats. You can cut the bass on each pass which makes the repeats sound “lighter” and like they’re floating away. Or you can cut the treble, and have the repeats get darker and darker, somewhat more cave-like and subterranean. Or you can do a bit of both, which gives you a band-limited sound on the repeats like someone on the telephone or a cheap radio. It’s pretty versatile.
The audio path keeps the dry signal entirely in the analog domain – it is never digitised and comes straight from the input buffer to the output mixer.
I’ve programmed ‘buffered bypass’ rather than add a true bypass footswitch, though this would be possible. The reasoning is that I can do noiseless switching in the firmware by providing a fade-out over a few milliseconds, and I can also offer the option of keeping the delay tails, which is important with so much delay available.
One further addition is the “echo splash” feature, whereby a short press on the bypass footswitch will toggle the effect on or off in the usual way, but a longer press (currently set at “over 0.5 second”) turns the delay on only while the switch is held down, and the delay goes off again when you take your foot off the button. This enables you to add echoes to just a single phrase, and sounds great with the delay trails.
The firmware also offers tap tempo as an alternative way of setting the delay time – just tap the interval you want on the other footswitch. There’s also an LED which flashes at the current delay rate to give you an idea of what’s going on, and there’s a Sync Output to provide a pulse which can synchronise other pedals to the delay rate.
A quick overview of the schematic
The analog side is simple stuff. There’s a buffer, from where the dry path goes off to the final mixer. That’s followed by a anti-aliasing filter, and then the delay line. The delay is followed by a differential op-amp since the DAC outputs a differential signal, and then two reconstruction filters. The final mixer mixes the wet signal back into the dry signal.
The digital side consists of the processor (with its internal ADC and DAC) and the two SRAMs.
The final parts are the five control pots, and the two supplies. The ADC/DAC use a separate 3.3V supply from the digital side to help keep noise to a minimum. The ground planes are separated on the PCB too.
I’ve used the “diode in parallel with circuit” style of reverse polarity protection rather than the alternative “diode in series with circuit”. The diode in series gives you a hefty voltage drop that I don’t care for. On the other hand, the diode in parallel will short out any power supply which is plugged in in reverse and might blow up the power supply. I regard it as my job to protect my circuit and the job of power supply designers to protect their power supplies from shorts (I mean, that’s pretty basic, right?). Just so you’re warned!
PCBs and chips for this project
Here’s a shot of the Rev.2 PCB in my first unit. It makes for a neat build since most of it is on the PCB. Getting the LEDs the right height requires a little forethought, but none of it is hard. I could have used board-mounted jacks too, but I thought it better to leave people the option of having whatever jacks they like best. I’ve put cutouts left and right for the jacks, and added a cutout on the top edge to make more room for a DC socket. I learned a lesson there from the Flangelicious boards where it’s a tight fit to get a DC socket on the top side of the PCB.
The PCB measures 109x70mm. It is designed to fit into a Hammond 1590BB enclosure in landscape format as above. The PCB-mounted pots make the build easier, and the off-board wiring is very simple.
Ok, so what do I need to build one?
Improving the S/N ratio for low-level guitar signals
There are two main sources of noise in this circuit; 12-bit quantisation noise, and the DAC noise. There’s nothing I can do to fix either of these. They are what they are. All we can do is try and get the best-possible signal-to-noise ratio from the circuit.
As shown in the schematic, the circuit can handle signals up to 3V peak to peak. To get the best noise performance, you need to use as much of this as you can.
If you’re using the circuit with a guitar with a low level output, changing four resistor values can be helpful. These changes boost the signal at the pre-delay filter, and then reduce it again at the output mixer (along with any noise). This gives an improvement in S/N of around 13dB. The maximum input signal level is reduced to 680mVp-p.
Here are the full details if you want to tweak the code, do your own PCB, or otherwise experiment with it.
DigiDelay DIY 4 Second Delay Project files
- DigiDelay construction guide (Updated to include guitar level mod above)
- DigiDelay enclosure drilling template
- DigiDelay panel graphic for waterside decal (as seen on prototype above) 100%=254DPI
- Rev.4 Schematic (Page 1)
- Rev.4 Schematic (Page 2)
- Rev.4 Schematic (Page 3)
- Rev.3 PCB Reference Designators
- Rev.3 PCB Component Values
Delay Processor and SRAM files
- DigiDelay delay processor chip datasheet
- DigiDelay delay processor dsPIC 33FJ64GP802 assembly code
- DigiDelay delay processor assembled .hex file
- 23LC1024 128KB SRAM datasheet
Going further: A dsPIC-based pedal of your own design?
It’s worth pointing out that the hardware presented here is pretty general purpose. You’ve got audio input/output with a dsPIC to process it and 256KB RAM if you need it. The interface consists of five knobs to control parameters in the code, and two footswitches. That’s a good start for a lot of different digital effects. A change of firmware could turn this into something completely different.
All files relating to DigiDelay by Tom Wiltshire for Electric Druid are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Here’s the legal stuff.