Hi, I am struggling with a little distortion plugin.
I have this function called at render :
bool FXTriodeClassA::render(ProcessData& buffers)
{
auto numSamples = buffers.getSamplesInBlock();
auto chanL = buffers.getOutputBuffer(0);
auto chanR = buffers.getOutputBuffer(1);
// create an updated TriodeClassAParameters
TriodeClassAParameters newTriodeParams;
newTriodeParams.waveshaper = (distortionModel)mParams[eTriodeA_Waveshaper].getLastValue();
newTriodeParams.saturation = mParams[eTriodeA_Saturation].getValue();
newTriodeParams.asymmetry = mParams[eTriodeA_Asymmetry].getValue();
newTriodeParams.outputGain = mParams[eTriodeA_OutputGain].getValue();
newTriodeParams.invertOutput = mParams[eTriodeA_InvertOutput].getLastValue();;
newTriodeParams.enableHPF = true;
newTriodeParams.enableLSF = true;
newTriodeParams.hpf_Fc = mParams[eTriodeA_HpfFC].getValue();
newTriodeParams.lsf_Fshelf = mParams[eTriodeA_LsfFShelf].getValue();
newTriodeParams.lsf_BoostCut_dB = mParams[eTriodeA_LsfBoostCutDb].getValue();
// call setParams
mTriodeClassA[0].setParameters(newTriodeParams);
mTriodeClassA[1].setParameters(newTriodeParams);
for (uint32_t i = 0; i < numSamples; i++) {
auto drywet = mParams[eTriodeA_DryWet].getValue();
auto sampleL = chanL[i];
auto sampleR = chanR[i];
auto processedSampleL = sampleL * (float)newTriodeParams.outputGain;
auto processedSampleR = sampleR * (float)newTriodeParams.outputGain;
chanL[i] = doLinearInterpolation(sampleL, processedSampleL, drywet);
chanR[i] = doLinearInterpolation(sampleR, processedSampleR, drywet);
}
return true;
}
The only computing I’m doing is here :
auto processedSampleL = sampleL * (float)newTriodeParams.outputGain;
auto processedSampleR = sampleR * (float)newTriodeParams.outputGain;
If I run this code in FL it makes the sound awful but it works perfectly fine on Reaper, Ableton and Bitwig.
If I simply remove the multiplication, no processing is happening and it’s a dry FX, but it sounds as expected in FL Studio.
Anybody knows if FL Studio has a different behavior than the others ?
Thx !