Hi everyone, I am trying to write my own Chorus class, and it is a month now that I am stuck on some wired glitchy clipping noise each time I do my sample processing. In the following example I used my own delayline class that is working just right, but i think something is wrong, something in the LFO calculation just is breaking everything…
float processSample(const int channel, const float inputSample)
{
m_currentPhase += m_phaseIncrement;
m_currentPhase = std::fmod(m_currentPhase, juce::MathConstants<float>::twoPi);
m_oscTime[channel] = std::sin(m_currentPhase + channel * juce::MathConstants<float>::halfPi) * currentDelayMod() / 2 + m_centreDelay;
// DBG("channl::" << channel);
// DBG("test::" << m_oscTime[channel]);
const float delaySamples = DelayLine::timeToSamples(m_oscTime[channel], m_sampleRate);
m_delayLine[channel].setDelay(delaySamples);
float outputSample = m_delayLine[channel].processSample(channel, inputSample);
return outputSample;
}
I am trying to learn, maybe is not the best code, but I’m pretty proud of it because it has been made without any external help, it means a lot to me. I wouldn’t be asking any help if I didn’t even tried to understand the error, but i think is something bigger than me… Thanks in advance to anyone that can help!