Delay implementation
-
- KVRer
- 4 posts since 17 May, 2013
Hello, i'm new to this forum as i've just started educating myself on audio DSP and plugin development. I have quite a good background in programming and also in DSP (have worked in radar processing, but never done audio before) My first project is a simple delay: as i love ambient music i'm really aiming at getting good at reverberation and delay algorithms. I'm trying to do everything by myself, without peeking at anyone's code. I think it's a good way to really understand how things work. So it's been quite easy for me to get a very simple delay implementation, with wet/dry balance, feedback and delay time. The implementation i came out with is a simple circular buffer with reading and writing pointers placed with a delayed offset, just like the heads on a tape delay work.
Now i'd like the processing to react to delay value changes with pitch changes, just as a tape echo or most of delay guitar pedals (and plugin) do when changing the delay while the delay trails are still hearable. My implementation just doesn't work like that.
My first thought has been to implement a "fractional" algorithm for the reading pointer positioning and then "driving" the pointer position with a function (ramp?) instead of directly changing it (it this makes sense)...
So any hint would be really appreciated, but if you can i'd be glad if you could avoid posting or linking code; that's becouse as i've already mentioned I really would like to figure out myself how it's to be done.
thanks!
Now i'd like the processing to react to delay value changes with pitch changes, just as a tape echo or most of delay guitar pedals (and plugin) do when changing the delay while the delay trails are still hearable. My implementation just doesn't work like that.
My first thought has been to implement a "fractional" algorithm for the reading pointer positioning and then "driving" the pointer position with a function (ramp?) instead of directly changing it (it this makes sense)...
So any hint would be really appreciated, but if you can i'd be glad if you could avoid posting or linking code; that's becouse as i've already mentioned I really would like to figure out myself how it's to be done.
thanks!
- KVRAF
- 2604 posts since 4 Sep, 2006 from 127.0.0.1
one way you can do this is:
when the delay time changes, you simply have to take the signal from the old buffer and "stretch" or "squeze" it into the new buffer (via some sort of interpolation)
fractional read position is a good idea too
when the delay time changes, you simply have to take the signal from the old buffer and "stretch" or "squeze" it into the new buffer (via some sort of interpolation)
fractional read position is a good idea too
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!
irc.libera.chat >>> #kvr
..as long as it has BASS and it's LOUD!
irc.libera.chat >>> #kvr
-
- KVRian
- 653 posts since 4 Apr, 2010
It's pretty simple. You have an interpolated delay line—as you suggest—end of story there.metamatic wrote:My first thought has been to implement a "fractional" algorithm for the reading pointer positioning and then "driving" the pointer position with a function (ramp?) instead of directly changing it (it this makes sense)...
Then you plug a one-pole low pass filter, set to a low cutoff frequency, between your control value and the delay control input.
http://www.earlevel.com/main/2012/12/15 ... le-filter/
That gives you a smooth, continuous, mechanical (tape deck, etc.) sounding change, where the pitch changes until the delay time settles.
Another alternative is a more digital-delay approach, where you quickly duck the delay output and bring it back up at the new setting. This way, you don't get a pitch change. It's an effect similar to rotating the dial on a radio, where it ducks the stations to avoid blasts.
Those are the methods I used in Echo Farm (TDM plug-in) and DL4 (stomp box), depending on the delay type, and people seem to like 'em
My audio DSP blog: earlevel.com
-
- KVRer
- Topic Starter
- 4 posts since 17 May, 2013
This sounds pretty cool! Thank you very much!earlevel wrote:
It's pretty simple. You have an interpolated delay line—as you suggest—end of story there.
Then you plug a one-pole low pass filter, set to a low cutoff frequency, between your control value and the delay control input.
p.s. How do you know this is Line6 implementation? just curious.
-
- KVRian
- 653 posts since 4 Apr, 2010
I was the developermetamatic wrote:This sounds pretty cool! Thank you very much!earlevel wrote:
It's pretty simple. You have an interpolated delay line—as you suggest—end of story there.
Then you plug a one-pole low pass filter, set to a low cutoff frequency, between your control value and the delay control input.
p.s. How do you know this is Line6 implementation? just curious.
To be clear, I'm not going to tell any company secrets, but this is very basic stuff. A one-pole to smooth changes from the delay control, that's it; when doing program/patch changes, duck instead, updating the delay element of the filter. I only mention the products to emphasize that, as simple as the solution sounds, it's legit.
My audio DSP blog: earlevel.com
-
- Banned
- 12367 posts since 30 Apr, 2002 from i might peeramid
you requested no code, you also requested hints 
there are other methods of interpolation beyond linear. for "musical delay lengths" (eg. 16th notes) linear is fine. high performance delay lines will benefit from an improved method. i recommend 2nd order hermite at that point.
code in pdf on my sem page
or dozens of other places online.
there are other methods of interpolation beyond linear. for "musical delay lengths" (eg. 16th notes) linear is fine. high performance delay lines will benefit from an improved method. i recommend 2nd order hermite at that point.
code in pdf on my sem page
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.
- KVRist
- 470 posts since 6 Apr, 2008
My conclusions concerning implementation of delay effects:
Parameter smoothing: a single 1-pole might not be enough to get really smooth behavior, because its output control signal still has a discontinuous 1st derivative which may result in audible steps of the pitch of the delay signal. Thus, what I do is to use two identical 1-pole slew limiters in series (identical time constants).
Interpolation even at 44.1kHz, linear interpolation gives decent results except in some rare cases. The advantage of more sophisticated (and CPU-expensive) methods further diminishes if you intend to do lowpass filtering in the delay loop. With sample rates of 88kHz and above, even with careful listening, linear interpolation for me is virtually artifact-free.
Parameter smoothing: a single 1-pole might not be enough to get really smooth behavior, because its output control signal still has a discontinuous 1st derivative which may result in audible steps of the pitch of the delay signal. Thus, what I do is to use two identical 1-pole slew limiters in series (identical time constants).
Interpolation even at 44.1kHz, linear interpolation gives decent results except in some rare cases. The advantage of more sophisticated (and CPU-expensive) methods further diminishes if you intend to do lowpass filtering in the delay loop. With sample rates of 88kHz and above, even with careful listening, linear interpolation for me is virtually artifact-free.
-
- Banned
- 12367 posts since 30 Apr, 2002 from i might peeramid
(by "high performance" i should say audio rate/"pitched" delays, under 10ms
eg. a recursive comb filter is where you'd start to hear a difference.)
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.
-
- KVRian
- 653 posts since 4 Apr, 2010
Of course, it depends on your intent. In the case I described, I'm talking about a very low Fc (long time constant), to simulate the mechanics of a mechanical system, and I like the first-order effect. At that frequency, you're not going to get any stair steps.karrikuh wrote:Parameter smoothing: a single 1-pole might not be enough to get really smooth behavior, because its output control signal still has a discontinuous 1st derivative which may result in audible steps of the pitch of the delay signal. Thus, what I do is to use two identical 1-pole slew limiters in series (identical time constants).
But at the same time, Echo Farm and DL4 use two 1-poles in smoothing the wow & flutter signals.
And for the benefit of others, a point that may not be obvious here is, as necessary, multiple one-poles and not a higher-order filter that can ring. Typically, you don't want to overshoot.
My audio DSP blog: earlevel.com
-
- KVRian
- 1002 posts since 1 Dec, 2004
I'm quite a fan of the 1-pole allpass filter for delay line interpolation. The cpu usage is low and it's especially good for physical modeling strings - any volume loss would accumulate quickly due to the very short delay line and very high feedback, so you need a technique that doesn't have volume loss at any frequency.
Dattorro paper on allpass interpolation for delay lines
Dattorro paper on allpass interpolation for delay lines
-
- KVRer
- Topic Starter
- 4 posts since 17 May, 2013
This morning i tried the one pole lowpass solution, and with a cutoff frequency of about 5Hz it just give the feeling I was describing, so it seems to work pretty good.
Now i'd like to add some special character to the delay. Could you suggest any paper/article on delay modelling?
Now i'd like to add some special character to the delay. Could you suggest any paper/article on delay modelling?
-
- KVRer
- 25 posts since 8 Dec, 2012
Not exactly a specific paper but there is tons of good stuff on Julius Smith's site, in particular this book has quite a few good ideas that you might be interested in checking out - https://ccrma.stanford.edu/~jos/pasp/
- KVRAF
- 3426 posts since 15 Nov, 2006 from Pacific NW
There's a chapter in the 2nd edition of the DAFX book that has a nice intro to tape echos. It is a pricey book, but if you are just starting into this, there is a lot of good info in this book.metamatic wrote:This morning i tried the one pole lowpass solution, and with a cutoff frequency of about 5Hz it just give the feeling I was describing, so it seems to work pretty good.
Now i'd like to add some special character to the delay. Could you suggest any paper/article on delay modelling?
http://www.amazon.com/DAFX-Digital-Udo- ... 0470665998
Be sure to get the 2nd edition - the 1st edition doesn't have any discussion of tape echos or analog modeling.
Sean Costello
-
- KVRian
- 653 posts since 4 Apr, 2010
True, but it's not so well suited to changing delays (that span more than one sample), no? Good for the steady state, though.MadBrain wrote:I'm quite a fan of the 1-pole allpass filter for delay line interpolation. The cpu usage is low and it's especially good for physical modeling strings - any volume loss would accumulate quickly due to the very short delay line and very high feedback, so you need a technique that doesn't have volume loss at any frequency.
My audio DSP blog: earlevel.com
