long digital delay build log

Started by cloudscapes, November 27, 2014, 10:40:47 PM

Previous topic - Next topic

cloudscapes

So I think I'll start this build log, and update progress on this project as I go. :D

I'm a huge fan of loooong delays. Several seconds worth. I use short delays too, but much of my ambient style comes from the long delays. So I think I'll build such a delay, inspired by one of my all-time favorites, the venerable PDS-8000!



So to begin with, what are its specs. The original is 8bit sound with heavy filtering, and has 3 delay ranges, 125-500ms, 500-2000ms, and 2000-8000ms (without modification). One of its key features is also a hold footswitch! I want to do better, however. Both in specs and in features. So I've come up with the hardware foundation that I think can get me started. I've been using PIC32s for a couple years, making granular samplers, bitcrushers, ringmods and all-round sound-wreckers, but nothing "musical" like a delay.

For ADC conversion, the MCP3201. It's "only" 12bit, but sounds pretty good, and for something to be inspired by the PDS-8000, it's fine that it's not too hi-fi. The DAC is the PT8211, which is 16bit. It's an inexpensive DAC found on eBay (and whatnot), I think marketed for cheap CD players and other consumer electronics with audio features. It sounds good to my ears. Both of these chips are easy to use, and can be clocked up to 100khz or so, if needed.

The memory was a bit harder. Initially I was going for the 23LC1024, which is a cheap serial SRAM, but decided on the MR25H40 instead, which is nearly the same, but with four times as much memory, and can be clocked a lot faster. Here are the 4 (instead of 3) delay ranges I'm aiming for:

- 54 - 218 ms
- 218 - 875 ms
- 875 - 3500 ms
- 3500 - 14000 ms

How did I come up with these awkward numbers? It was based on the available memory from the MR25H40, the fact that I want each range to cover about 4 octaves of delay time "bending", and how fast the microcontroller can clock samples through. So on all ranges, a samplerate range of 18khz to 72khz. Switching between ranges accesses a different amount of memory, rather than just changing the sameplerate. These ranges are a pretty good upgrade from the original PDS-8000!

Some features and specs I have in mind:

- 12bit input, but 16bit internal headroom and output (large swells)
- delay time knob, covering 4 octaves on each delay range
- feedback knob, of course
- fun ways to tweak the feedback, such as a resonant filter, and digital erosion filter I have in mind
- possibly some time stetching that doesn't alter the pitch, might create some potentially interesting "smearing" of delay loops
- hold footswitch, like the PDS-8000, may also double as tap-tempo, reverse, etc..
- soft-stomp relay bypass
- modulation, inspired by the PDS 20/20! mod speed, depth and multiple LFO shapes could be interesting
- subtle feedback ducking, possibly, based on sound input

Whew, that's a lot of features/pots. So I made this board to help me develop it:



It's most of the core hardware I wrote about, plus some sockets for additional RAM, plus power jack (left corner). Made to be tacked along the top of my breadboard. Started experimenting with this today, configuration code, a basic memory ring, some buffers, and this:



Doesn't yet have any interesting filters in the feedback path yet, so it's fairly clean. The opamp buffers are pretty hackish, I'll need to redo them since I didn't really know what I was doing for this test. I'll update as I get ahead. :)
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

deadastronaut

awesomo....

i'm a fan of looooong delays too...great fun.

looks like a great project.. 8)
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//

knutolai

It will probably end up amazing as always  :icon_biggrin:
On a different note. If you made a thorough-ish "getting started with PIC for audio"-guide for brain dead fools like myself, everyone (or just me) would love you forever!

karbomusic

Nice. I used to own and use that exact pedal at my gigs back in the late 80s/ early 90s.

cloudscapes

Today I will focus on cleaning up my opamp buffer mess. I'm gonna need a lot of them (between filters, mixing wet and dry, in feedback path, etc) so I'll do a nice neat row lower down the breadboard that I can patch into.

The other thing, right now my memory ring takes advantage of the integer word limit to wrap around to 0 after 65535, so my delay is exactly 65536 samples long at the moment. Not very flexible. But it was an easy test to see if the hardware could work as a delay! So now I'll set up some kind of function/system for delay ranges, with a wrap-around at whatever sample limit I define, both going forwards or backwards (to support reverse delay, and potentially time stretching). It'll also enable me to use the full 262,144 16bit samples available on the RAM chip.

Quote from: knutolai on November 28, 2014, 10:39:11 AM
It will probably end up amazing as always  :icon_biggrin:
On a different note. If you made a thorough-ish "getting started with PIC for audio"-guide for brain dead fools like myself, everyone (or just me) would love you forever!

Hopefully it won't end up like my looper dev log from a couple years back. ;) Though the reasons why I haitused that one aren't a problem here, so it should be fine.

I could try and compile some guides/tips I wrote a while back on other forums. It's not super in-depth, though. And I wouldn't want to give bad advice. Some things I'm doing aren't elegant, though they work.
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

cloudscapes

I look forward to the interesting stuff I can put in the feedback path!

Ringmod, maybe? Refold audio over and over again will lead to some really interesting overtones!

Bitcrusher? Good for emulating really lofi 80s delays!

Pitch shifter? Tack on an FV-1!

Diodes? I'm already thinking of using diodes to clamp audio for the ADC input, so that when it clips, it clips in an interesting manner, rather than digitally.

Definitely a filter, probably resonant.
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

slacker

Sounds great already, also I like how you've mounted the DC jack very neat.

Quote from: cloudscapes on November 28, 2014, 12:20:07 PM
Pitch shifter? Tack on an FV-1!

A pitch shifter is a great idea, your PIC's probably got enough memory to do one.

cloudscapes

Quote from: slacker on November 28, 2014, 12:51:44 PM
Sounds great already, also I like how you've mounted the DC jack very neat.

Quote from: cloudscapes on November 28, 2014, 12:20:07 PM
Pitch shifter? Tack on an FV-1!

A pitch shifter is a great idea, your PIC's probably got enough memory to do one.


Probably, I won't be using any of the PIC's internal 64KB for the delay, since that's all external memory. It's just I don't know how to do pitch-shifting. Even after looking at how others do it and the theory, I'm just bad at math.
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

knutolai

QuoteI look forward to the interesting stuff I can put in the feedback path!

In my experience there are just too many awesome options. The way I like to do this is add a send/return in the feedback path that goes in front of your filter. This way there really isn't any limits as you can add other external effects to the loop.

micromegas

wow! This thing is awesome

Feedback loop is the way I'll go..
Software Developer @ bela.io

Strategy

The delay sample foldback idea is interesting. There is a Boss pitchshifter/delay pedal (can't remember which one, maybe PS-2) that when you tweek the delay time, the pitch stays put, but you get this very musical glitching as the sample in the delay line is crunched back and forth. Very few pedals have this characteristic (though perhaps the EHX "#1 Delay" does?). I think it's possible to do this with FV-1 but its generally a pretty unexplored territory.

If you could have the delay switchable between "classic" (pitch changes when you tweek Time) and "glitching" (pitch stays same, sample gets munched) that would be cool. Both options in one pedal!

Strategy
-----------------------------------------------------
www.strategymusic.com
www.community-library.net
https://soundcloud.com/strategydickow
https://twitter.com/STRATEGY_PaulD

cloudscapes

Quote from: Strategy on November 28, 2014, 03:59:52 PM
The delay sample foldback idea is interesting. There is a Boss pitchshifter/delay pedal (can't remember which one, maybe PS-2) that when you tweek the delay time, the pitch stays put, but you get this very musical glitching as the sample in the delay line is crunched back and forth. Very few pedals have this characteristic (though perhaps the EHX "#1 Delay" does?). I think it's possible to do this with FV-1 but its generally a pretty unexplored territory.

If you could have the delay switchable between "classic" (pitch changes when you tweek Time) and "glitching" (pitch stays same, sample gets munched) that would be cool. Both options in one pedal!

Strategy

Yeah, I'm sort of wanting to experiment with glitching kind of how you describe. I don't know how doable it'll be, but one non-pitch-shifting time-stretch trick I know of is do do something like this with playback:



where imagine this is playback direction. This kind of "stutter" could happen many times a second, every few milliseconds. I could set it so that after every 66 samples forward, it goes back 33, then 66 forward again, etc. It works, it's glitchy, but it works. I imagine interesting things putting this in the feedback path!

I'm attempting to design this so that the sample address for sampling can be different than that for playback. I'm introducing an address offset modifier. If I put that modifier for when I'm playing back a sample (like +1 66 times, then -1 33 times, repeat), but no modifier when sampling and storing to memory, then I *think* I can have layers of progressivly time-stretched audio in the feedback path! Audio smearing!

I don't know how well any of this will work. This afternoon I've been attempting to lay down functions that will allow me this kind of sample manipulation, then we'll see.
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

cloudscapes

#12
I implemented a basic time-stretching thing today. it's simply for every % of samples going forward through the memory ring, go backwards the remainder of %. for example, I tell it to go forward 1000 samples, then backwards 500, then repeat. it all takes a fraction of a second at 72khz. setting it to 50/50 would sort of freeze the loop. not sure I liked the result though, too noisy, because changing direction mid-smooth-wave creates sharp edges in the wave. so if you've recorded a smooth sine wave (or guitar with a heavy filter) you'll have sharp edges where it should normally be rolling hills. unsure if I'll keep this implementation.

EDIT: I may have found another way..
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

aballen

So many builds, I just can't list them anymore.

cloudscapes

Most commonly heard phrases in my home in the last 48 hours:

1. This should be working!
2. This shouldn't be working..
3. I changed nothing since this worked..
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

cloudscapes



Playing around with glitchy time stretching and reverse while in hold mode.

I'm also thinking of a way to do pitch shifting in the feedback path while not in hold mode. basically I have to give ADC+memory write, and memory read+DAC their own separate samplerate controls. their own separate timers, address counters and memory wrapping logic. the delay's main samplerate control would control both, but a "pitch shift" pot could offset one of them faster or slower. I think that should give me constant pitch shifting.

I still have yet to do my delay range control to properly manage memory addresses and wrapping. I should do that before I do too much else.
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

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//

armdnrdy

Here's a good analysis on how Danelectro implemented their backwards effect. Maybe it can be of some help.

http://www.electrosmash.com/back-talk-analysis
I just designed a new fuzz circuit! It almost sounds a little different than the last fifty fuzz circuits I designed! ;)

cloudscapes

#18
Thanks armdnrdy :) I might learn a thing or two!

This morning, I got the four delay ranges working, as well as the smarter address counter needed! I hooked up a 4 position rotary switch (the big one near the bottom right of the breadboard in the last video). The four ranges are as follows

54 - 218 ms        3,924 samples
218 - 875 ms        15,750 samples
875 - 3500 ms      63,000 samples
3500 - 14000 ms   252,000 samples   

The delay clocks up to 72khz on the fast end of any of the ranges, when tweaking the delay time pot, down to a still acceptable 18khz on the slow end.

Currently if you switch from a smaller range to a larger range, you start hearing what was recorded the last time you were in that larger range, since its accessing those memory banks. The PDS-8000 clears the memory when switching between ranges to avoid this. I can do that..... or I can just leave it as is as some kind of effect. Or I can make it optional through a jumper on the eventual PCB. Clearing the entire memory bank would probably hang the whole pedal for a second or so, though.

Another thing, the memory I'm using retains its data when powered off (like flash memory)! That's pretty cool! So I think I'll make the pedal remember if it was in loop hold mode or not when powering back on, reengage hold mode and just keep playing that old loop!
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

cloudscapes

#19


This is what happens when I give the ADC/memory write, and memory read/DAC independant samplerate control, with their own memory address counters!

A bit glitchy, due to sameplerate timers occasionally fighting for interrupt priority.

The delay (while not in these crazy modes) works pretty well, digitally/code-wise. So I think now I'll focus a bit on the analog side. Get some nice bandpass filters going. Better buffers, clipping protection, etc.
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}