Im a beginner and im trying to keep a smooth sound when changing parameters through a gui. I made a couple of filters, based on the WolfSound tutorial on youtube about filters. I used the smoothedvalue class, but theres still some zipping or glitchy sound when changing parameters. In particular the cutofffrequency parameter.
My pluginprocessor class uses the AudioProcessorValueTreeState Class to keep my parameters. The stepsize for the cutofffrequency is 0.01 hz, which seems small enough to me. So thats not the problem.
Then every block i call this once:
const auto cutOffFrequency = cutOffFrequencyParameter->load();
filter.setCutOffFrequency(cutOffFrequency, buffer.getNumSamples());
where the cutOffFrequency instance variable of the filter class is this:
juce::SmoothedValue<float, juce::ValueSmoothingTypes::Multiplicative> cutOffFrequency;
and where filter.setCutOffFrequency() is defined like this:
void LowHighPassFilter::setCutOffFrequency(float cutOffFrequency, int steps)
{
this->cutOffFrequency.reset(steps);
this->cutOffFrequency.setTargetValue(cutOffFrequency);
}
Then when calculating the filter output i do this for every next sample:
- I call cutOffFrequency.getNextValue() and put it in a variable
- I use this variable inside the calculation of the filteroutput sample
Question 1:
Shouldnt this smoothen parameter changes?
Question 2:
I know i register a parameter change only every block, but i thought since i use smoothedvalue it shouldnt really matter because the value that is registered the next block will smoothly ramped towards in the calculations. Is this correct?
Question 3:
Since im a beginner. If there is something unusual about my code,methods,architecture,patterns, could you please give me tips or point me towards standard/best practices regarding audio parameters. Also tips regarding performance would be great, if there is any.