Plugin output behaving weird

Hello people :slight_smile:

Sorry for the non descriptive title, but I can’t even find words to describe the issue…

Somehow my audio output values seem to be scaled when I’m inside an IF statement.

Here’s the code snipplet: (And yes, the code is a bit quirky)
this is inside the processBlock function

...
if (out > 0)    // doesn't print to console when playhead is paused
        DBG ("out: " + String (out));

channelData[i] = out;

if (delayInSamples != previousDelayInSamples)
{
            numSamplesToInterpolate = totalSamplesToInterpolate;
            DBG("delayInSamples changed");
}

if (numSamplesToInterpolate > 0)
{
        out = 1.0f;
        DBG("inside IF :" + String(out));
        channelData[i] = out;
        --numSamplesToInterpolate;
}
...

The console output is as expected:

...
out: 0.98587
out: 0.985885
out: 0.985917
out: 0.985946
out: 0.985964
out: 0.985965
delayInSamples changed
inside IF :1
inside IF :1
inside IF :1
inside IF :1
inside IF :1
inside IF :1
...

BUT, this is the waveform when I record the plugin’s output to reaper.

On top of that, if I do

out = 2;

the sample is at 0dBFS.

Any ideas?

Rollo

Can you test with some other host or audio editor to rule out it being some kind of a problem or feature in Reaper itself?