I’ve been struggling with this problem, about my audio plugin unexpected send overloaded signal out to DAW(Ableton Live 10). Mostly on right track channel, only registred ones on left channel. It can happen when using it, or even if no audio is feed into it.

Its a delay plugin, and I’m using processorChain( adding JUCE Ladderfilter, My Own chorus/fanger fx).

It would be too much asking you to read my code, but if anyone has had a similary problem I would like to hear from you. Could it be an audio buffer not handled correct? ProcessorChain calls prepare(), proces() and reset() - and I don’t do anything in my reset() in chorus fx - could that be a problem?

This is a huge culprit in circular buffers of delay lines. They need to be zero’d before you begin writing data to them.

I do this in the prepare() function. I post it here below so you can see. It is my Chorus/flanger template class that I’m using within a processorChain juce::dsp::ProcessorChain<juce::dsp::LadderFilter, ChorusFlanger> processorChain; adding it to my feedbacked delayed signal. I think the problem might be in this class, because the problem only happens when the Chorus effect is not bypassed. The plugin can work perfectly fine using the chorus effect, but then suddenly plugin burst out audible overloaded audio on meter track(DAW).

^ looks like you’re using unique_ptrs, so you don’t need these braces, just reset them to the right length when prepareToPlay is called.

Other than that nothing is immediately sticking out as the obvious culprit.

Does it happened regularly enough for you to reproduce it?

Sometimes wrapping a check for nan or inf at the end of the process block, which triggers a breakpoint if true at the end the process block can be really helpful for stopping program execution when an issue like this occurs.

Is there a change in samplerate?

It could also be that because of those checks for nullptr, when sample rates change the buffers are not resizing to the correct length, and then you have a buffer overrun because your mCircularBufferLength is larger than the buffer itself.

Yes, hehe, part of the code is from a intro JUCE course I took earlier this year at kadenze, but I have reimplemented it as a template class so that it can be used in a processorChain. That way I can also reuse it in other projects.

Jake_Penn - are you Jacob Penn(Output) course teacher at kadenze. If so, thank you again for a great course - I’ve learned a lot.

Jake_Penn:

Does it happened regularly enough for you to reproduce it?

Yes, but it does not happen every time I run it. Sometime it can run for 30 minutes before an error occur.

Jake_Penn:

Is there a change in samplerate?

Not that I know of. I’ve place a std::out << “prepare called”; in the prepare() functions. That way I will know if sample rate change unexpected.

Try generating the output sample and passing it through these before into the output buffer. At the very least until you track down the issue, this will stop the execution so you can go through and find where things are becoming funny

Hello again.
Yesterday I was optimistic, but today the problem is back. Sample rate does not change running plugin. Referring to the posted code above, I placed jassert in for loop (processing buffer) before outputBlock.

Looking at the debug window and in code, it looks like readHeadRight_x1 exceeds mCircularBufferlength ( (Sample rate)44.100 * 2(max delay time) = 88.200) by 1. And readHeadRight_x1 is set to 1 (look in code, and debug win)

And readHeadFloatRight is 0 (look in code, and debug win). Therefore delay_sample_right is assigned NaN because readHeadFloatRight(0) is put into the interpolation function.

Hey I’m retaking the course as I wasn’t fully focused before (bought the second one over Black Friday sale) – for some reason I’m having code issues that it seems like others aren’t having.

jmap is throwing an error – I see the two template types for jmap - one with 3 params, one with 5. For some reason the 3 param one is throwing a ‘2. Candidate function template not viable: requires 3 arguments, but 5 were provided’.

Hello @grimmwerks. I asked a similar question on kadenze course forum. If you search for “jmap” you will find it. Bruce responded like this:

Hey Michael, things like this usually depend on the leniency of your compiler – some compilers are more strict than others. When using a jmap, which is a “template” function, the template needs to know that all arguments are of the same templated type, which in this case is a float. Good job solving this issue!

jmap((float)lfoOut, -1.f, 1.f, 0.005f, 0.03f);

------end Bruce

In my code I do this:

jmap<float>(lfoOutLeft, -1.0f, 1.0f, 0.005f, 0.03f);

Since this is a template function, I think this is better. Hope this help.

Speaking of templates functions/classes. @daniel and @Jake_Penn, I have solved my problem. I could’t find any code that could produce a nan/Inf. Instead the issue was that I did’t use the typename in my template class