Exported plugin creates static noise

i finally succeeded in finishing a plug… or more like almost. it really appears in my daw, which is cubase artist 9.5 on windows 10. but it creates a static noise that sounds like a highpassed saw-wave or something, instead of its actual effect, which is kind of a filter thing. what could i have missed?

void _2020_01_27_slewAudioProcessor::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());

    slewLimiter.setChannelsCount(buffer.getNumChannels());

    for (unsigned int s = 0; s < buffer.getNumSamples(); ++s) {

        slewLimiter.setSlew(*slewParam);
        checkGainParams();

        for (unsigned int ch = 0; ch < buffer.getNumChannels(); ++ch){
            auto * channelData = buffer.getWritePointer(ch);
            
            channelData[ch] = float(mix(channelData[ch], slewLimiter.run(channelData[ch], ch) * makeup, *mixParam) * outGain);
        }
    }
}

here’s my processBlock-method. since the problem is sound-related maybe it comes from where the sound is being set.

It’s very difficult to tell without knowing more details but this seems wrong :

float(mix(channelData[ch], slewLimiter.run(channelData[ch], ch) * makeup, *mixParam) * outGain);

Should not that maybe be instead :

float(mix(channelData[s], slewLimiter.run(channelData[s], ch) * makeup, *mixParam) * outGain);
1 Like

actually yes, that was it :smiley: thx. i should freak out less about minor inconveniences…

btw do you know if it’s possible to send audio to the plugin while debugging it in visual studio, so i don’t have to build everytime to check audio properties? the thing is… now the plugin only does something for the gain values, the mix-knob pretends like dry and wet is the same and the filter has no effect at all even though i wrote and tested the exact same code in plug’n script