Add little saturation to Leiwand setting

This commit is contained in:
Ludwig Frühschütz 2025-04-20 11:48:11 +02:00
parent 33ee4560c5
commit 40ab4bfe68
2 changed files with 10 additions and 0 deletions

View File

@ -128,6 +128,14 @@ void LeiwandizerAudioProcessor::prepareToPlay (double sampleRate, int samplesPer
gain.reset();
gain.setGainDecibels(-2.0f);
saturation.prepare(spec);
saturation.reset();
saturation.functionToUse = [](float x) {
float satFactor = 0.05f;
x = satFactor * x;
return ( x / (1 + std::abs(x)) ) / satFactor;
};
lowCutFilterOa.prepare(spec);
auto lowCutOa = juce::dsp::IIR::Coefficients<float>::makeHighPass(sampleRate, 100.0f, 5.0f);
lowCutFilterOa.coefficients = *lowCutOa;
@ -236,6 +244,7 @@ void LeiwandizerAudioProcessor::processBlock (juce::AudioBuffer<float>& buffer,
lowShelfFilterLw.process(context);
highShelfFilterLw.process(context);
gain.process(context);
saturation.process(context);
compressor.process(context);
limiter.process(context);
}

View File

@ -63,6 +63,7 @@ private:
juce::dsp::Compressor<float> compressor;
juce::dsp::Limiter<float> limiter;
juce::dsp::Gain<float> gain;
juce::dsp::WaveShaper<float> saturation;
//Oasch DSP
juce::dsp::IIR::Filter<float> lowCutFilterOa;
juce::dsp::IIR::Filter<float> highCutFilterOa;