So my end goal is to have a synth that can have its output delayed with a slider and I did the actual implementation of the circular buffer in the processBlock of my pluginProcessor however my synthesizerVoice sound still plays the same when I manipulate the delayTime to any value in the getFromDelay() method, can someone point me in a direction to go for achieving my end goal?
auto totalNumInputChannels = getTotalNumInputChannels();
auto totalNumOutputChannels = getTotalNumOutputChannels();
for(int i = 0; i < magicSynth.getNumVoices(); i++){
if(magicVoice = dynamic_cast<SynthesizerVoice*>(magicSynth.getVoice(i))){
magicVoice->getEnvelopeParams(tree.getRawParameterValue("attack"), tree.getRawParameterValue("decay"), tree.getRawParameterValue("sustain"), tree.getRawParameterValue("release"));
magicVoice->getWaveType(tree.getRawParameterValue("waveType"));
magicVoice->getWaveType2(tree.getRawParameterValue("waveType2"));
magicVoice->getFilterParams(tree.getRawParameterValue("filterType"),
tree.getRawParameterValue("filterCutOff"),
tree.getRawParameterValue("filterRes"));
magicVoice->getMasterParams(tree.getRawParameterValue("masterGain"),
tree.getRawParameterValue("blend"));
}
}
buffer.clear();
const int bufferLength = buffer.getNumSamples();
const int delayBufferLength = mDelayBuffer.getNumSamples();
for (int channel = 0; channel < totalNumInputChannels; ++channel)
{
const float* bufferData = buffer.getReadPointer(channel);
const float* delayBufferData = mDelayBuffer.getReadPointer(channel);
float* dryBuffer = buffer.getWritePointer(channel);
fillDelayBuffer(channel, bufferLength, delayBufferLength, bufferData, delayBufferData);
getFromDelayBuffer(buffer, channel, bufferLength, delayBufferLength, bufferData, delayBufferData);
feedbackDelay(buffer, channel, bufferLength, delayBufferLength, bufferData, delayBufferData, dryBuffer);
}
mWritePosition += bufferLength;
mWritePosition %= delayBufferLength;
magicSynth.renderNextBlock(buffer, midiMessages,0, buffer.getNumSamples());
updateFilter();
dsp::AudioBlock<float> block (buffer);
stateVariableFilter.process(dsp::ProcessContextReplacing<float> (block));
scopeDataCollector.process(buffer.getReadPointer(0), (size_t)buffer.getNumSamples());
}