Some splitting of code
This commit is contained in:
38
Source/SynthVoice/EQ.h
Normal file
38
Source/SynthVoice/EQ.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#pragma once
|
||||
#include "../SynthVoice.h"
|
||||
|
||||
void NeuralSynthVoice::renderEQ(juce::dsp::AudioBlock<float> &block)
|
||||
{
|
||||
// ================================================================
|
||||
// EQ + Master + Limiter (EQ guarded by eqOn)
|
||||
// ================================================================
|
||||
const bool eqEnabled = shared.eqOn && shared.eqOn->load() > 0.5f;
|
||||
|
||||
auto& eqL = chain.get<eqLowIndex>();
|
||||
auto& eqM = chain.get<eqMidIndex>();
|
||||
auto& eqH = chain.get<eqHighIndex>();
|
||||
|
||||
if (eqEnabled)
|
||||
{
|
||||
eqL.coefficients = juce::dsp::IIR::Coefficients<float>::makeLowShelf (
|
||||
spec.sampleRate, 100.0f, 0.707f,
|
||||
juce::Decibels::decibelsToGain (shared.lowGainDbls ? shared.lowGainDbls->load() : 0.0f));
|
||||
|
||||
eqM.coefficients = juce::dsp::IIR::Coefficients<float>::makePeakFilter (
|
||||
spec.sampleRate, 1000.0f, 1.0f,
|
||||
juce::Decibels::decibelsToGain (shared.midGainDbls ? shared.midGainDbls->load() : 0.0f));
|
||||
|
||||
eqH.coefficients = juce::dsp::IIR::Coefficients<float>::makePeakFilter (
|
||||
spec.sampleRate, 10000.0f, 0.707f,
|
||||
juce::Decibels::decibelsToGain (shared.highGainDbls ? shared.highGainDbls->load() : 0.0f));
|
||||
|
||||
eqL.process (juce::dsp::ProcessContextReplacing<float> (block));
|
||||
eqM.process (juce::dsp::ProcessContextReplacing<float> (block));
|
||||
eqH.process (juce::dsp::ProcessContextReplacing<float> (block));
|
||||
}
|
||||
|
||||
chain.get<masterIndex>().setGainDecibels (shared.masterDbls ? shared.masterDbls->load() : 0.0f);
|
||||
chain.get<masterIndex>().process (juce::dsp::ProcessContextReplacing<float> (block));
|
||||
|
||||
chain.get<limiterIndex>().process (juce::dsp::ProcessContextReplacing<float> (block));
|
||||
}
|
||||
Reference in New Issue
Block a user