OBJECTIVE:
Experimenting and Learning
TARGET:
VST3 on Windows Platform
PROBLEM:
What I notice is that I have to bypass Band-2, and Band-3 (see processor chain below) in order for me to hear output.
I’m using makeLowShelf, makePeakFilter, and makeHighShelf to generate the coefficients for my filters.
IN HEADER FILE
using FilterBand = dsp::ProcessorDuplicator<dsp::IIR::Filter<float>,
dsp::IIR::Coefficients<float>>;
using Gain = dsp::Gain<float>;
dsp::ProcessorChain<
Gain,
FilterBand, //Band-1...........LowShelf
FilterBand, //Band-2...........Peak
FilterBand, //Band-3...........Peak
FilterBand, //Band-4...........Peak
FilterBand, //Band-5...........Peak
FilterBand, //Band-6...........Peak
FilterBand, //Band-7...........Peak
FilterBand, //Band-8...........Peak
FilterBand, //Band-9...........High Shelf
Gain> filter;
PREPARE-TO-PLAY
void eqAlphaAudioProcessor::prepareToPlay(double newSampleRate, int newSamplesPerBlock)
{
sampleRate = newSampleRate;
dsp::ProcessSpec spec{ sampleRate, uint32(newSamplesPerBlock), uint32(getTotalNumOutputChannels()) };
for (size_t i = 0; i < bands.size(); ++i)
{
updateFilters(i);
}
auto& inputGain = filter.template get<0>();
auto& outputGain = filter.template get <10>();
inputGain.setGainLinear(*state.getRawParameterValue(paramInput));
outputGain.setGainLinear(*state.getRawParameterValue(paramOutput));
filter.prepare(spec);
}
PROCESS-BLOCK
void eqAlphaAudioProcessor::processBlock(AudioBuffer<float>& buffer, MidiBuffer& midiMessages)
{
ScopedNoDenormals noDenormals;
ignoreUnused(midiMessages);
// -- Update Analyzer with input buffer data
if (bypassed)
{
filter.reset();
bypassed = false;
}
dsp::AudioBlock<float> block(buffer);
dsp::ProcessContextReplacing<float> context(block);
filter.process(context);
// Update analyzer with output data
}

