# dsp::Chorus feedback bug

**URL:** <https://forum.juce.com/t/dsp-chorus-feedback-bug/40578>\
**Category:** Development\
**Created:** [July 7, 2020, 12:33pm UTC](https://forum.juce.com/t/dsp-chorus-feedback-bug/40578 "2020-07-07T12:33:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![scopedaudio](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@scopedaudio](https://forum.juce.com/u/scopedaudio)\
**Post date:** [July 7, 2020, 12:33pm UTC](https://forum.juce.com/t/dsp-chorus-feedback-bug/40578/1 "2020-07-07T12:33:40Z")

</div>

Hi all,

I’m checking out the new Chorus in the Juce 6 dsp module. Sounds amazing.  
However the feedback isn’t doing much.

In the Chorus.h file process() call at line 128 we have:

```
        for (size_t i = 0; i < numSamples; ++i)
        {
            auto input = inputSamples[i];
            auto output = input - lastOutput[channel];

            delay.pushSample ((int) channel, input);
            delay.setDelay (delaySamples[i]);
            output = delay.popSample ((int) channel);

            outputSamples[i] = output;
            lastOutput[channel] = output * feedbackVolume[channel].getNextValue();
        }

```

Seems that the output with the feedback factor is not pushed into the delay line and the output is overwritten after reading the delay.  
Changing into this seems to make more sense and I can hear the feedback clearly.

```
        for (size_t i = 0; i < numSamples; ++i)
        {
            delay.pushSample ((int) channel, inputSamples[i] - lastOutput[channel]);
            delay.setDelay (delaySamples[i]);
            auto output = delay.popSample ((int) channel);

            outputSamples[i] = output;
            lastOutput[channel] = output * feedbackVolume[channel].getNextValue();
        }

```

Also, should the lastOutput be added or subtracted to the input? 🧐

Hope this helps.  
Best,  
Milan

---

<div class="post-metadata">

**Author:** ![IvanC](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ivanc/32/685_2.png) [@IvanC](https://forum.juce.com/u/IvanC)\
**Post date:** [July 7, 2020, 3:55pm UTC](https://forum.juce.com/t/dsp-chorus-feedback-bug/40578/2 "2020-07-07T15:55:21Z")

</div>

Thanks for the feedback, it’s going to be fixed asap.

> [@scopedaudio](#):
>
> Also, should the lastOutput be added or subtracted to the input? 🧐

Yes it’s normal, feedback consequence is not going to sound the same with addition or substraction, traditionally we find minus sign here in chorus audio effects algorithms, but you can play with addition instead and see what you prefer.
