Sorry for waking up a several weeks old topic, I did try to change the plugin from a mono settings to a stereo settings but unfortunately the problem is still the same with the lowpass filter :
PrepareToPlay :
void RunDubDelayAudioProcessor::prepareToPlay(double sampleRate, int samplesPerBlock)
{
// Use this method as the place to do any pre-playback
// initialisation that you need..
delayBufferLength = (int)10.0 * (sampleRate);
if (delayBufferLength < 1)
delayBufferLength = 1;
delayBuffer.setSize(2, delayBufferLength);
delayBuffer.clear();
if (MSBPMToggle) setDelayMS();
else setDelayBPM(paramHolder.delayLengthBPM);
ignoreUnused(samplesPerBlock);
lastSampleRate = sampleRate;
//mySynth.setCurrentPlaybackSampleRate(lastSampleRate);
dsp::ProcessSpec spec;
spec.maximumBlockSize = samplesPerBlock;
spec.sampleRate = sampleRate;
spec.numChannels = getTotalNumOutputChannels();
lowpassFilter.reset();
lowpassFilter.prepare(spec);
highpassFilter.reset();
highpassFilter.prepare(spec);
}
ProcessBlock :
int dpr, dpw;
// This is the place where you'd normally do the guts of your plugin's
// audio processing...
// Make sure to reset the state if your inner loop is processing
// the samples and the outer loop is handling the channels.
// Alternatively, you can process the samples with the channels
// interleaved by keeping the same state.
float* channelData0 = buffer.getWritePointer(0);
float* channelData1 = buffer.getWritePointer(totalNumInputChannels == 2 ? 1 : 0);
float* delayData0 = delayBuffer.getWritePointer(0);
float* delayData1 = delayBuffer.getWritePointer(totalNumInputChannels == 2 ? 1 : 0);
dpr = delayReadPosition;
dpw = delayWritePosition;
for (int i = 0; i < numSamples; ++i) {
const float in0 = channelData0[i];
const float in1 = channelData1[i];
// DRY_WET
float dw0 = (1 - paramHolder.dryWetMix) * in0 + paramHolder.dryWetMix * delayData0[dpr];
float dw1 = (1 - paramHolder.dryWetMix) * in1 + paramHolder.dryWetMix * delayData1[dpr];
// LPHP
updateFilter();
//float lphp0 = (lowpassFilter.processSample(dw0) + highpassFilter.processSample(dw0))/2;
//float lphp1 = (lowpassFilter.processSample(dw1) + highpassFilter.processSample(dw1))/2;
float lphp0 = lowpassFilter.processSample(highpassFilter.processSample(dw0));
float lphp1 = lowpassFilter.processSample(highpassFilter.processSample(dw1));
UpdateFilter :
void RunDubDelayAudioProcessor::updateFilter() {
lowpassFilter.parameters->type = dsp::StateVariableFilter::Parameters<float>::Type::lowPass;
lowpassFilter.parameters->setCutOffFrequency(lastSampleRate, paramHolder.lpMix);
highpassFilter.parameters->type = dsp::StateVariableFilter::Parameters<float>::Type::highPass;
highpassFilter.parameters->setCutOffFrequency(lastSampleRate, paramHolder.hpMix);
}
The parameters where I define my filters in the PluginProcessor.h :
struct ParamHolder : ParamManager::ParamHolderBase {
Param<bool> bypass{ this, "Bypass", false };
Param<float> delayLengthMS { this, "TimeMS", NormalisableRange(0.0f, 10000.0f, 10.0f), 500.0 };
Param<int> delayLengthBPM { this, "TimeBPM", Range(0, 18), 1 };
Param<float> feedback { this, "Feedback", NormalisableRange(0.0f, 0.995f, 0.005f), 0.75 };
Param<float> dryWetMix { this, "DryWet", NormalisableRange(0.0f, 1.0f, 0.01f), 0.5 };
Param<float> panMix { this, "Pan", NormalisableRange(0.0f, 1.0f, 0.01f), 0.5 };
Param<float> widthMix { this, "Width", NormalisableRange(0.0f, 5.0f, 0.1f), 1.0 };
Param<float> lpMix{ this, "LowPass", NormalisableRange(20.0f, 20000.0f, 0.01f, 1.f), 20000.0 };
Param<float> hpMix{ this, "HighPass", NormalisableRange(20.0f, 20000.0f, 0.01f, 1.f), 20.0 };
Param<float> speed { this, "Speed", NormalisableRange(0.0f, 17.0f, 0.01f), 0 };
Param<float> amnt { this, "Amnt", NormalisableRange(0.0f, 20.0f, 0.01f), 0 };
} paramHolder;
ParamManager paramManager { this, paramHolder };
I’m feeling I’m going in circles with this filter, I tried to switch from mono to stereo and tried serial/parallel configurations, I’m starting to think that it’s another functionnality that interfere with the filters but if it is then I don’t know which one.