4 second digital delay project

Started by ElectricDruid, December 29, 2016, 03:01:04 PM

Previous topic - Next topic

ElectricDruid

Hi all,

I've finally finished the Digital Delay project I've been working on. Full details are over on my website:

http://electricdruid.net/diy-digital-delay/

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




I started off trying to use a PIC to add tap tempo to the PT2399, using PWM to control a current sink, including a calibration routine by reading the frequency of the PT2399's clock output with the PIC. I spent a long time on it before I gave up. Ultimately, the PT2399 isn't worth that amount of effort. So then I started a "blank sheet" digital delay design. I wanted to keep it all through-hole rather than SMD, and I wanted it as simple as possible. Those two criteria decided the chip choices and a lot else.
The hardware is very similar to what Slacker came up with in a earlier thread:

http://www.diystompboxes.com/smfforum/index.php?topic=106741.20

We were both applying similar conditions (easy breadboarding/prototyping, cheap, simple) and so got to similar results. My final design uses a 33FJ64GP802 dsPIC in 28-pin DIP, and a couple of 8-pin DIP 128KB SRAMs.

Anyway, full schematics and code are available for people to play with, and you could use the hardware as a jumping-off point for your own dsPIC pedal development. I've got PCBs and programmed chips available for purchase if you just fancy building one rather than getting into programming.



Enjoy the echoes!..choes!..choes!..oes!..s!

Tom

lars-musik

It is simply great that you share your fine projects. Thanks a lot! But I'll have a hard time putting this into a 1590a!

cloudscapes

How are you varying the delay time? Variable samplerate above and below 32khz? Or some DSP kung-fu?  ;)
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

ElectricDruid

Quote from: cloudscapes on December 29, 2016, 04:02:29 PM
How are you varying the delay time? Variable samplerate above and below 32khz? Or some DSP kung-fu?  ;)

No, this version uses a fixed sample rate. The delay time is varied by moving the read pointer which follows the write pointer through RAM. To avoid glitches, the old position and the new position are cross-faded while it changes.

One day I'd like to do a variable-sample-rate version, because I'd like to add a delay time CV modulation input. But for now, the most important thing was to get this one finished.

T.

ElectricDruid

One other late addition to the code that I forgot to mention is a Sync Output. It outputs a short pulse at the current tempo (either set by the Delay Time knob or tapped on the Tap Tempo footswitch). This could be used to sync other pedals based on the TAPLFO or similar chips. Since the TAPLFO includes multipliers, you could have a (for example) phaser running at twice the delay speed, or half, or x1.5, or whatever.
God only knows what happens with a tremolo and a delay sync'd up. Could you have the delay fill in the bits the trem makes quiet? Lots of possibilities, anyway.

T.

midwayfair

My band, Midway Fair: www.midwayfair.org. Myself's music and things I make: www.jonpattonmusic.com. DIY pedal demos: www.youtube.com/jonspatton. PCBs of my Bearhug Compressor and Cardinal Harmonic Tremolo are available from http://www.1776effects.com!

deadastronaut

https://www.youtube.com/user/100roberthenry
https://deadastronaut.wixsite.com/effects

chasm reverb/tremshifter/faze filter/abductor II delay/timestream reverb/dreamtime delay/skinwalker hi gain dist/black triangle OD/ nano drums/space patrol fuzz//

mth5044

Can't wait to order! Definitely will put in a purchase within a fews.

Is it hard to set the delay time, especially in the shorter settings? I wonder if it would be worth adding a selector short/medium/long similar to what boss did/does with their delay time selector.

How do you think it react to an LDR placed across the delay time pot for modulation with a TAPLFO/LED?

ElectricDruid

I tweaked the delay time pot control response with a look-up table for exactly the reason you give - with a linear control, it's hard to set the shortest times accurately, since even a quarter of the way around is a full second of delay. The final response looks like this:



As you can see, half way round the pot is only a bit over 1/2 second, and even 2/3rds round is only a second. The very long times are all at the end. It feels very natural because of the "octave character". Don't forget there's tap tempo too, so that's handy for long times.

I don't know how it'd react to delay time modulation. I haven't tried it. It does some cool stuff if you twiddle the knob, and sounds like it's playing backwards and stuff, but I wasn't aiming for delay time modulation on this version. I will one day do a variable sample rate version which would be better for delay time modulation.

mth5044

Cool, thanks for the detailed response! Nice work around for the delay time. Should have figured you had it down since all of your projects are so detailed and complete! Can't wait to build it. Thanks again and happy new year!

bean

Got mine ordered. I'm going to build the sh*t out of this. Thanks for making the project available!

potul

Wow, nice project using a dspic.  I did my first DSP tests using one of these.

I see you programmed it in ASM. Any reason not to use C? performance?

Are you using DMA to read ADC?

ElectricDruid

Quote from: potul on January 02, 2017, 12:14:05 PM
Wow, nice project using a dspic.  I did my first DSP tests using one of these.
They're pretty powerful chips if you start really using the DSP features.
Quote
I see you programmed it in ASM. Any reason not to use C? performance?
No particular reason, beyond personal taste. I don't much like C, in truth. I know where I am with Assembly - there's nothing in there which I didn't put in. I like that. The performance gain is a bonus.
Quote
Are you using DMA to read ADC?
No, not here, although I often have on other projects. On this one, I read them "manually" because I've interleaved the reads so that the audio channel gets read much more often than the pots. The read pattern goes like this:

Audio, CV0, Audio, CV1, Audio, CV2, Audio, CV3, Audio, CV4, Audio, CV5, and then back to the beginning.

With a 64.8KHz ADC read rate, I get a sample rate of 32.4KHz for the audio, and 32.4/5 =6.48KHz for the pots. While the DMA will do some clever stuff, I couldn't figure out a way to make it do that!

Tom

cloudscapes

Quote from: ElectricDruid on January 02, 2017, 01:57:02 PM
No, not here, although I often have on other projects. On this one, I read them "manually" because I've interleaved the reads so that the audio channel gets read much more often than the pots. The read pattern goes like this:

Audio, CV0, Audio, CV1, Audio, CV2, Audio, CV3, Audio, CV4, Audio, CV5, and then back to the beginning.

With a 64.8KHz ADC read rate, I get a sample rate of 32.4KHz for the audio, and 32.4/5 =6.48KHz for the pots. While the DMA will do some clever stuff, I couldn't figure out a way to make it do that!

I do this as well, partly because I'm not smart enough to figure DMA out. All my pots take turns being sampled on slower-than-audio-rate timer.
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

ElectricDruid

Quote from: cloudscapes on January 02, 2017, 07:39:46 PM
I do this as well, partly because I'm not smart enough to figure DMA out. All my pots take turns being sampled on slower-than-audio-rate timer.

It's not so much a question of "smart" in order to figure DMA out, rather "willing to try about a million possibilities until one works"! Once you've got one working set-up, it's easier to tweak it. But finding that first working set-up has eaten days of my life, for all kinds of things.

And anyway, the round-robin sampling thing is a useful trick too, so if we've got that sorted, it's all good.

T.

Beo

Quote from: ElectricDruid on December 29, 2016, 07:13:35 PM
One other late addition to the code that I forgot to mention is a Sync Output. It outputs a short pulse at the current tempo (either set by the Delay Time knob or tapped on the Tap Tempo footswitch). This could be used to sync other pedals based on the TAPLFO or similar chips. Since the TAPLFO includes multipliers, you could have a (for example) phaser running at twice the delay speed, or half, or x1.5, or whatever.
God only knows what happens with a tremolo and a delay sync'd up. Could you have the delay fill in the bits the trem makes quiet? Lots of possibilities, anyway.

The sync output could be used to drive an led/lcd display for delay time. I did something like this in my 1000 competition entry:
http://www.diystompboxes.com/smfforum/index.php?topic=96870.420

I recently picked up a 1980's Ibanez DM2000, in part for its 1sec delay but also for it's Hold and Modulation functions. If there's any room for additions in your design, these are two functions I'd like to see.

Looking forward to building this! Thanks E Druid!

potul

Quote from: ElectricDruid on January 02, 2017, 08:12:48 PM
Quote from: cloudscapes on January 02, 2017, 07:39:46 PM
I do this as well, partly because I'm not smart enough to figure DMA out. All my pots take turns being sampled on slower-than-audio-rate timer.

It's not so much a question of "smart" in order to figure DMA out, rather "willing to try about a million possibilities until one works"! Once you've got one working set-up, it's easier to tweak it. But finding that first working set-up has eaten days of my life, for all kinds of things.

And anyway, the round-robin sampling thing is a useful trick too, so if we've got that sorted, it's all good.

T.

That was my experience in the past as well.. it's really a nightmare to figure out a working example using DMA. I lost weeks trying to make it work, and I'm not sure I could replicate it now.


bean

Got mine built up but I'm having a bit of noise. Voltages seem to check out (solid 3.3v off the regulator and around 4.2v Vb off a steady 9.14v supply), and all my parts/values are correct.

I audio probed around to see what I could find. Some noise and whine out of pin25 which seems to be exacerbated by the filter section (probing at their outputs) so when it gets to the circuit output it's pretty loud. At first I had it plugged into my testing rig which includes a charge pump for different voltage selection (9, 15, 18, -9) so I bypassed that and went straight to the One Spot. That definitely did help with some noise but it's still pretty bad. Also swapped out for a different batch of TL072 just in case. I have not tried plugging into another power supply but my One Spot is pretty solid for testing (and obviously the build isn't boxed yet). Should I expect some noise level with this build or are there any suggestions on where to look next? Delay itself is working great.

12Bass

Quote from: ElectricDruid on December 29, 2016, 03:01:04 PM

  • 12 bit/32KHz input, 16 bit/32KHz output

Guessing this is a typo... unless the circuit is somehow increasing the bit depth.
It is far better to grasp the universe as it really is than to persist in delusion, however satisfying and reassuring. - Carl Sagan

cloudscapes

Quote from: 12Bass on January 10, 2017, 04:37:10 PM
Quote from: ElectricDruid on December 29, 2016, 03:01:04 PM

  • 12 bit/32KHz input, 16 bit/32KHz output

Guessing this is a typo... unless the circuit is somehow increasing the bit depth.

Not saying it isn't a typo, but this is actually fine for some effects. If the feedback path for delay/reverb type of effects is digital, then it would benefit from a higher bitdepth DAC.
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}