What am i doing incorrectly or forgetting to do

so i am working on an asymmetrical overdrive plugin (a copy of Logic Pro Clip Distortion). i have two dsp::Gain’s one titled leftGain the other rightGain.

in my process block this is my code

    float t = *apvts.getRawParameterValue("Drive"); // T = Total drive
    float p = *apvts.getRawParameterValue("Symmetry"); // P = Symmetry Percentage (0.5 * T) = 50% of drive
    float rightDrive = 0.f;
    float leftDrive = 0.f;
    
    if (p < 0.5f)
    {
        rightDrive = (1.0f - p) * t;
        leftDrive = p * t;
    }
    if (p > 0.5f) 
    {
        rightDrive = p * t;
        leftDrive = (1.0f - p) * t;
    }
    if (p == 0.5f)
    {
        rightDrive = t * p;
        leftDrive = t * p;
    }

    leftGain.setGainDecibels(leftDrive);
    rightGain.setGainDecibels(rightDrive);

    juce::dsp::AudioBlock<float> block(buffer);

    auto& leftBlock = block.getSingleChannelBlock(0);
    auto& rightBlock = block.getSingleChannelBlock(1);

    

    juce::dsp::ProcessContextReplacing<float> leftContext(leftBlock);
    juce::dsp::ProcessContextReplacing<float> rightContext(rightBlock);


    leftGain.process(leftContext);
    rightGain.process(rightContext);

the problem i have is while symmetry is 0.50 the signal is centered, when the slider i have is dragged up so 0.50 is increased, the signal starts to pan to the right, not process the right more than left but pan the actual signal to the right.

similarly when the slider is dragged down the signal is panned right again. clearly i am doing something wrong but i can’t figure it out.

clipdis

any thoughts? thanks

excuse my OCD.

these statments are equivalent to

if (p < 0.5f)
{
    rightDrive = (1.0f - p) * t;
    leftDrive = p * t;
}
else
{
    rightDrive = p * t;
    leftDrive = (1.0f - p) * t;
}

I suggest using the simpler version. (I’m not sure what the bug is but).

1 Like

But isn’t that what panning is? You are making the sound on the left softer and the sound on the right louder, so it sounds like it’s more on the right.

1 Like

Yep, just realised that :man_facepalming:
I think what I was searching for the “Bias” for dc.

Haha yes, I typically don’t be this messy. The bug in question wasn’t really a bug, increasing gain in the right is supposed to pan the sound. I was searching for a DC Bias, silly mistake.