Posted by & filed under BBDs+Delays, Projects, Stompbox stuff.

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.

DigiDelay pedal

 

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
  • Noiseless 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.

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.

digidelay-schematic-pg1

The digital side consists of the processor (with its internal ADC and DAC) and the two SRAMs.

digidelay-schematic-pg2

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!

digidelay-schematic-pg3

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.

DigiDelay pedal guts

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?

DruidConstructionGuidePDF

Pop over to the shop and grab the DigiDelay PCB + chipset, which includes the PCB, DIGIDELAY delay processor chip, and the two SRAMs. You might also need a set of pots for the project.

The only documents which you’ll really need are the DigiDelay construction guide. and the DigiDelay enclosure drilling template.

Project files

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

Delay Processor and SRAM files

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.

Creative Commons License
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.

45 Responses to “DIY 4 Second Digital Delay”

  1. Robert

    Awesome! Finally a “non-pt2399” digital delay 😉 I am pretty sure this could be combined with the VC/Tap-LFO to get modulated delay time? Can’t wait for the files, thanks again for a great project!

    Reply
    • Tom Wiltshire

      Hey, wait till you’ve heard it before you big it up! But thanks for the positive vibes!
      Modulated delay time with the TapLFO would be pretty wild. You’d have a ton of options available then. Since the delay time on this one is a CV input (although 0-3.3V range) it should be doable, although I’ve got some heavy smoothing on the CV inputs on this chip to prevent noise from the ADC finding its way into the audio. So fast modulation might not be an option. I’ll bear it in mind though. Perhaps when it’s all done, I can experiment with backing the filtering off a bit to see how far it can go.

      Reply
      • L´Andratté

        “…with backing the filtering off a bit to see how far it can go.”

        Yes, please do that! Because it is no just a freaky idea, but one of the strangest synth effects I know, to s&h-modulate the delay time!

        Anyway, hats off to you and I´m in for one (;
        Best, Jörn

        Reply
  2. O.Z.

    Tom,
    Looks very promising! I concur with Robert – at last … beyond PT2399
    O.Z.

    Reply
  3. Mark Wills

    Hi there

    I’m interested in the software technique you are using the produce the delay. I wondered if I could ask some questions? The way I imagine it working is to have a sample-write pointer that continually loops around from one end of memory to the other, writing the data sampled at the A/D as it goes? Then a sample-read pointer (which also loops around memory in the same way) is running a fixed distance away from the sample-write pointer? The longer this distance the bigger the delay – meaning sample rate never changes – just the “distance” between the read/write points? Is that how it works? I ask because I’m interested in having a go myself at some of this, though the PIC world is new to me!

    Also, any idea how stereo delay effects are produced? How is the stereo effect made? Is it just a fade up/down between the left/right channels?

    Reply
    • Tom Wiltshire

      The way you imagine it is exactly the way I’ve done it. The write pointer cycles through the memory, and the read pointer follows along behind. The further behind it is, the longer the delay.
      This method does throw up one or two problems of its own (a variable sampling rate would have different plusses/minuses). For example, how do you change the delay time? If you simply jump the read pointer to the new location, you get an abrupt change in the signal and an audible click. If you twist the ‘delay time’ knob, the repeated clicks become a hideous “zippering” noise. So then you have to think about either speeding the read pointer up with respect to the write pointer to shorten the delay (or slowing it down for a longer delay) or crossfading from the old location to the new. Various different commercial units have used all these methods, and each has advantages and disadvantages. I’m going to try the speeding-up/slowing-down method, because I’d like to have the possibility of modulating the delay time. We’ll see how that goes!

      “Stereo” Delay effects can be generated many, many different ways, but mostly they depend on having different delay times for the two channels, which makes the sound apparently “bounce around” between right and left. Have a look at the “algorithm guide” for the old Boss SE-70 for a few ideas:

      http://cdn.roland.com/assets/media/pdf/SE-70_PA.pdf

      Good luck!

      Reply
  4. neandrewthal

    Whether or not these features are a stock part of the design I would love to have a tap input, tap clock output and a multiplier knob for interfacing with other devices.

    How is the tap function being handled on this? If it was from the Tap LFO chip that you sell then the features I want would be lying dormant within it waiting to be teased out by whomever wants them. If it`s a little dedicated chip like the flangelicious with all it`s features maxed out already that`s a different story.

    Reply
    • Tom Wiltshire

      Tap input is definitely included – I’ve done that one already. Tap Clock output is not very likely, although I’ve got a Tempo LED output. I’ve been using PWM to make a “flash with decay” on the LED, so it’s not ideal as a clock output. Perhaps it would be better just a simple square wave so that it could also be used as a Clock output too. Pity, because visually it doesn’t look as good. I’ll think about that one.
      Multiplier knob is pretty much certainly not going to happen, since I’m out of ADC inputs. But with the tap input, you ought to be able to use a TapLFO to sync it up at pretty much any speed you want.

      Reply
      • neandrewthal

        Ok. I can live without the multiplier.

        Im only one person, but I would strongly prefer a square wave for syncing multiple effects, even if the LED blink isnt as good. Then I would be able to multiply up and down the other effects I am syncing (provided they have a multiplier knob of course!)

        Any idea yet on what enclosure size it will fit into?

        Reply
    • Tom Wiltshire

      Hi,
      I got stuck trying to work out how to deal with the delay time modulation, so I’ve been taking a break from it to see if anything occurs to me. What I should do is get what I’ve got so far online though, and let you all have a look. It’s all functional apart from changing the delay time, which is glitchy. I’ll try and make time to get the schematic and current code up.

      Reply
  5. J. P.

    It seems like a lot of early 8-12 bit delays used companding. Do you think this delay could benefit from that addition (as done in the PT2399 delay you describe)?

    On a side note, I put in my vote for delay modulation to produce flange/chorus effects 🙂

    Reply
    • Tom Wiltshire

      Yeah, if you’re concerned about noise, then companding will help. It’s not a perfect process, so it can affect the dynamics somewhat. Perhaps that doesn’t matter too much since it’s only on the echos.
      My prototype is quiet, but by no means silent, but I’ve only got 12dB filters before and after the delay, whereas I’ve put 24dB filters in the schematic. That should help keep the noise down further too, since a lot of what I’m hearing is digital hash and would filter out quite well. When I do a PCB I’ll find out.
      Your vote for delay modulation is noted. I think what I’m going to do is get Version One out in the world as soon as I get the glitches out of the Delay Time knob. This uses a fixed sample rate and doesn’t include delay time modulation.
      After that, I might do an alternative firmware (Version two) using a variable sample rate, which makes delay time modulation a *lot* easier to do, at the cost of lower quality for the longest delays. That may or may not be a significant cost depending on what the final sample rates finish up being. We’ll see when I get there, I guess.

      Thanks for the interest, nonetheless.
      Tom

      Reply
  6. J. P.

    Regarding companding, I actually wonder if that added analog circuitry could explain some of the distinctive sound of the early digital delays (i.e., it might be desirable beyond reducing noise). I imagine that analog filtering closer to the audible range could also explain some of the sound. Good luck with a cool project!

    Reply
    • Tom Wiltshire

      Yes, for sure the compounding adds a certain something. Some of the PT2399 delays that are out there manage to get a pretty accurate “analog” sound by using very dark filtering (3KHz isn’t unheard of) and using the original companders. The same tricks would work equally well on this.
      Some other things have been shuffled on the list, so I’m hoping to get back to this shortly. Watch this space.

      Reply
  7. Tim

    Very cool stuff can’t wait to hear some sounds. I like the idea of 12 bit adc.
    Thanks a lot for sharing all these great projects. Because of you i ordered a programmer and hope to use your designs in a diy synth. Althought i am still a noob 😃

    Not sure but here they are writing about methods to interpolate between samples in delay lines https://ccrma.stanford.edu/~jos/pasp/Delay_Line_Interpolation.html

    What kind of interpolation strategy did you implement?

    Btw someone metioned clock input for tap tempo. I achieved this with a simple tranny as switch on the tap tempo button. Like this i did my first mod ever, did it on a memory boy deluxe and its realy usefull.
    Actually many of the features requested are implement in this delay.. cv controll of feedback would be my suggestion.

    Cheers. Tim

    Reply
    • Tom Wiltshire

      Thanks Tim. As an update, I’ve got a Rev.1 PCB designed which goes off for manufacture this week. Once I’ve got those back, I’ll do the final polish on the code and get it all online. Sorry it’s taking so long.

      I haven’t used any interpolation, since the delay time is altered by changing the distance between the write pointer and the read pointer in the delay. Interpolation would be required if the delay was modulated, but that’s not going to make it into the first version of the code. I might look at doing a variable-sample-rate version for version two (if I ever get that far) which would then allow delay time modulation without the processor hit of interp.
      Tap tempo is included, though. There’s an input for that. And the “Feedback amount” knob is attached to a 0->3.3V CV input, so you could add external CV control of that without too much trouble.

      Tom

      Edit: I’ve been reading the link you posted about delay interpolation. I did in fact implement the crossfade like they talk about in “Large delay changes”, the last section. If you don’t crossfade, you get a glitch when the delay pointer jumps from one place to another.

      Reply
    • Imran attari

      Hello
      I am very interested for this effect processor.
      But I don’t know where to buy this ic.
      You tell me address for buying this ic.
      And tell me this delay only mono or have a with ping pong delay?

      Reply
      • Tom Wiltshire

        I’ll post a link to the relevant shop page when I get it online. I have to check the prototype PCBs and finalise the code first though. The prototype PCBs should be done in a few weeks, and then I’ll need to polish the code and order production quantities of PCBs and chips. This takes a while, but I want it out there before Christmas.
        Thanks for your interest!
        Tom

        Edit: Sorry, forgot to add – the delay is only mono. There’s no second output for stereo, and no ping pong delays. It would be possible, but the current code doesn’t do it.

        Reply
  8. Tim

    Hi Tom thanks a lot for the update. For me it hasn’t be taking long as i just found this project 😃 i will first have to start learning to program pic.

    Cheers

    Tim

    Reply
  9. Will

    Hi Tom… nice project you have, and thanks for sharing to the DIY community! I was just wondering if it’s possible to implement program patches so one could recall them, I mean, I can program various delay settings (with all 5 parameters) and store in some internal memory, and pushing a stompswitch I could recall those programs.

    Thanks!
    Will

    Reply
    • Tom Wiltshire

      Hi Will,

      Hey, nice idea. I’ll have a think about it. I have often wondered about programmable pedals. The trouble is working out the interface. Do you have LEDs to show you which program you’re on? or a 7-segment display? Full-on LCD? Can you edit stored settings? How does the position of the knobs relate to the sound you’re hearing? These are the sort of things that make it less straightforward. But there’s nothing insurmountable!

      Thanks,
      Tom

      Reply
      • Will

        Hi. Thanks for write back. Yes indeed a programmable pedal suposes more complexity in the interface… but looking as an example my Korg 301-dl delay pedal, it has just 2 delay programs that make it very versatile: with one extra momentary stompswitch and a two-color led, besides the on-off effect stompswitch and status led. With this extra switch one can store the potentiometers status in its two programs so it can be recalled later.

        It’s just an idea… 2 delay patches are better than one.

        Thanks again, looking forward for your project! Cheers

        Will

        Reply
  10. Colin

    This seems like this may be a good candidate for a pseudo 16 second digital delay. Ive been trying to come up with a delay that could mimic the functions of the original unit, particularly the “always recording” function of the infinite switch. I’m pretty new when it comes to digital work but would it be possible to be able to infinitely loop one cycle of the delay without filtering (or the ability to add in filtering to emulate infinite filtering of old tape delay units.) Would it then be possible to dd octave/speed doubling or reverse loop type stuff? I’m sorry if these ideas seems way out of the scope of this project, but I really love the old EHX delay, especially what Nels Cline does with it.

    https://www.youtube.com/watch?v=i_fr9hpfQk8

    Reply
  11. Kevin

    Hi
    Its along time since I looked at your site. Nice to see it has expanded and thank you for sharing the code.
    I also can’t wait for this to come out. (Modulation would be nice – but I think I will be buying with or without.)

    Just an idea but could this project be modular?
    I mean sections: 1. the delay line, 2. input-output, 3. program control offering a number of program patches (limited to say 8 patches – how may delay time changes do you need?).
    That way the builder has a choice of how complex a delay they build. Also the ability to add two delay lines in parallel or series may be interesting. I appreciate that the more complex the project, the the bigger the box, but what are 19″ rack units for?
    I also think that a programmable control unit could be implanted into other effects. (How about Flangerlicious with 8 programmable presets now that would be nice!)

    As an aside any chance of a multi-tap version. Say 4 or 5 taps with about 500ms each tap? I was think of the old ADA STD multi tap delay that used a Multi-tap BBD chip (MN3011). I appreciate that this would involve being able to set the length of each delay line individually and may be beyond any reasonable scope for a DIY project – just an idea.

    Kevin

    Reply
    • Tom Wiltshire

      Hi Kevin,

      All good ideas, thanks! For starters, I just want to get what I’ve got so far finished off and ‘out there’, and then I can think about revisiting it and perhaps doing some of the other possibilities. Stereo outputs is another possibility that the chip would be capable of, so there’s a lot of options.

      Tom

      Reply
      • L´Andratté

        “…, but I want it out there before Christmas.”
        Very nice, Tom, to see this happening. Seriously, I have been looking for years for a diy delay just like that. I would also be interested in version 2 happening someday…

        Reply
        • Tom Wiltshire

          Latest news is that I’ve got the prototype PCBs back and they’re working, though they need one or two minor tweaks. I’m currently working on getting the firmware sorted out before I release it. I spoke to my DSP guru friend, and he made several recommendations for improvements that I’m trying to incorporate. These should reduce noise as far as possible and generally improve the audio quality. I’d used only 16-bit variables for the tone filters for example, but for best performance, I should really store 32-bit variables for those filters.

          So it’s coming along.

          Tom

          Reply
  12. Greg

    Great project without being another pt-thingie.

    Any estimation when pic/pcb may be available?

    Reply
    • Tom Wiltshire

      PCBs are ordered and on their way – so probably 2-3 weeks time. I haven’t ordered dsPICs yet, but they have a similar lead time. I’m aiming to get it in the shop by Christmas, but with the way shipping tends to slow to a crawl over the Christmas period, that might be a bit tight. If it’s not Christmas, it’ll be shortly after.

      Tom

      Reply
  13. dronecloud

    Great project! Nice to have more delays accessible that aren’t a pt2399 or fv1. Get people into the advanced stuff. 🙂

    I built a similar one a while back. Pic32 instead of dspic, though.

    Reply
      • Marcus

        Thanks for the nice project!! I don’t see the sync input on the digidelay, only sync out. How can I wire the taplfo into the digidelay?
        Thanks a lot!!

        Reply
        • Tom Wiltshire

          The tap tempo button on the DigiDelay can have a transistor in parallel with it, just like the tap tempo button on the TapLFO. See the right hand side of this schematic.
          Otherwise, you can use the Sync Out on the DigiDelay to the Tap Tempo input on the TAPLFO – it achieves the same thing, but with the Delay being the ‘master’ and the TapLFO being the ‘slave’.

          Reply
    • Tom Wiltshire

      No, TAPLFO not Taptation. The Taptation chip is designed for one thing only – adding tap tempo to the PT2399 using a digipot. The TAPLFO is a bit more general purpose, and one thing it can do is sync to incoming pulses and produce a clock output at some multiple of the input. You could wire it up like the top half of this schematic. You’d be using the clock output, so you can ignore the PWM filtering op-amps on the bottom half of the schematic. Similarly, you could ignore the Waveform and Output Level controls – just use a 10K to 5V for those.

      Reply
  14. Highphi

    Does this circuit have analog feedback like the old Boss DD-2 and DD-3? Looks like an amazing project!

    Reply
    • Tom Wiltshire

      The example schematic I’ve shown doesn’t have analog feedback – the feedback (repeats) are done digitally to save resampling the signal and adding more quantisation noise. But it would be easy to use the chip with analog feedback if you wanted to. Just connect the Repeats CV (Pin 3) to 0V (to disable the digital repeats), and change the input buffer into an op-amp mixer to mix analog feedback. You can use an analog level control too if required; tie the Delay Level CV (Pin2) to 3.3V so the DIGIDELAY chip gives its maximum output, and then control the level with a standard volume pot.
      How many of the digital features you use is up to you, really. You can treat the chip+SRAMs as simply a very long delay line if you want to, and do all the rest in analog – this gives you the option of having other pedals/tone controls/filtering in the feedback loop and so forth.
      My 4 second delay circuit is just an example application circuit for the datasheet, and not the only way you could use the chip by any stretch.
      HTH,
      Tom

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *