Mainstage plugin audio noise

Intermittently when loading my component in Mainstage it blows up in a horrible deal killing way.
Any suggestions how to debug this ?
In 2023 how are audio buffers cleared of garbage in JUCE applications ?

You’re going to have to provide more details about what you mean by ‘blows up’, its not obvious whats going on.

how are audio buffers cleared of garbage in JUCE applications?

… by not being fed garbage in the first place. If you are asked for audio data and provide noise, you’ll get noise. But if you provide silence, you’ll get silence. There are very few means by which ‘garbage buffers’ can be fed to the JUCE audio processing loop without programmer intervention …

Just keep in mind that JUCE doesn’t automatically clear out the buffers it gets, so if you don’t overwrite every sample in every output buffer, sometimes there may be garbage in it.

thanks I wonder if this code is still necessary in JUCE 7 ?

void waylosynth2::processBlock(AudioBuffer<float> &buffer, MidiBuffer &midiMessages)
    ScopedNoDenormals noDenormals;
    auto totalNumInputChannels = getTotalNumInputChannels();
    auto totalNumOutputChannels = getTotalNumOutputChannels();
    for (auto i = totalNumInputChannels; i < totalNumOutputChannels; ++i)
        buffer.clear(i, 0, buffer.getNumSamples());

Yes, you need to clear out the buffers for any channels the plug-in isn’t using.

I think the problem here may have been an unitialized value. Somewhere not sure it went away for now hopefully.