# Pops after changing the delay time

**URL:** <https://forum.juce.com/t/pops-after-changing-the-delay-time/51598>\
**Category:** Audio Plugins\
**Created:** [May 25, 2022, 9:47am UTC](https://forum.juce.com/t/pops-after-changing-the-delay-time/51598 "2022-05-25T09:47:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![corder](https://avatars.discourse-cdn.com/v4/letter/c/58f4c7/32.png) [@corder](https://forum.juce.com/u/corder)\
**Post date:** [May 25, 2022, 9:47am UTC](https://forum.juce.com/t/pops-after-changing-the-delay-time/51598/1 "2022-05-25T09:47:19Z")

</div>

Hello, everyone,  
I saw a few posts about smoothing, modulating, and resampling the delay line but my problem is a bit different I guess.  
I tried the juce\_DelayLine which has a few different interpolation types. It works well but I noticed something when I tried to test it with a pure sine or a mix of a few sines to see if there are any pops or clicks. I don’t change the delay time continuously, my knob is a kind of state knob.  
When I play the sine and try to change the delay line it creates a small pop after changing the delay time. It is not a huge pop but it is there. When I change the delay time only once, I get one pop. When I change it two times I get one pop for each change. Sometimes it does not happen but mostly it pops.  
Some people use a low-pass filter to get rid of this and get a kind of tape effect but I want mine to be very clear and smooth during changing the delay time.

I am open to all kinds of suggestions, I can share my code but I just followed the simple steps,

1. reset in the constructor,
2. prepare in prepareToPlay
3. process in processBlock
4. setDelay in paramaterChanged

Thanks in advance 🙏

---

<div class="post-metadata">

**Author:** ![oli1](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/oli1/32/15664_2.png) [@oli1](https://forum.juce.com/u/oli1)\
**Post date:** [May 26, 2022, 9:09am UTC](https://forum.juce.com/t/pops-after-changing-the-delay-time/51598/2 "2022-05-26T09:09:35Z")

</div>

Any discontinuation in an audio stream will create audible artefacts; you will always need to work around them. Interpolation, filtering, ramping/crossfading and parameter smoothing, etc., are some of the few things you can do.

---

<div class="post-metadata">

**Author:** ![corder](https://avatars.discourse-cdn.com/v4/letter/c/58f4c7/32.png) [@corder](https://forum.juce.com/u/corder)\
**Post date:** [May 26, 2022, 1:15pm UTC](https://forum.juce.com/t/pops-after-changing-the-delay-time/51598/3 "2022-05-26T13:15:36Z")

</div>

I see, I will try to debug more 🙂 the strange thing is that the generic DelayLine itself is doing it. I didn’t implement additional things. Thank you for your answer 🙏

---

<div class="post-metadata">

**Author:** ![oli1](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/oli1/32/15664_2.png) [@oli1](https://forum.juce.com/u/oli1)\
**Post date:** [May 26, 2022, 1:27pm UTC](https://forum.juce.com/t/pops-after-changing-the-delay-time/51598/4 "2022-05-26T13:27:50Z")

</div>

DelayLine is a DSP primitive; you still need to add the plumbing to make it play nice 🙂…

From DelayLine docs:

```auto
Note: If you intend to change the delay in real-time, you may want to smooth changes to the delay systematically using either a ramp or a low-pass filter.

```
