Hey I’m looking for a way to manipulate the EQed audio block, and I’m not sure what is the right way,
For now I wrote
for (auto i = totalNumInputChannels; i < totalNumOutputChannels; ++i)
buffer.clear (i, 0, buffer.getNumSamples());
auto audioBlock = juce::dsp::AudioBlock<float>(buffer);
auto context = juce::dsp::ProcessContextReplacing<float> (audioBlock);
filter.process(context);
for (int channel = 0; channel < totalNumInputChannels; ++channel)
{
auto* channelData = buffer.getWritePointer (channel);
for(int sample = 0; sample < buffer.getNumSamples(); sample ++)
{
auto cleanSignal = buffer.getSample(channel, sample);
channelData[sample] *= (driver * ranger) / 2;
channelData[sample] = ((((((2.f / M_PI) * atan(channelData[sample])) * blender) + (cleanSignal * (1.f - blender)))/2) * volumer);
}
}
and it kinda works, but I guess that what I’m getting Is a clean eq block on top of the distorted one
Im trying to treat the filter context as a new buffer
channalData = filter.procces(context)
So basically 2 questions:
- Is that the right way of doing this? or tips how you’d do it otherwise
- If so, how would you write it?