Voltage controlled filter implementation


Hi folks,

need some help with a voltage controlled filter. I tried a lot of thinks, but i dont get it working in the way i want it.
If u use the Juce IIR Filter Class for static frequency surposes, everything works fine.
But when i try to change the frequenzy with time, crackling is the result.

Things I tried:

  1. change the cutoff in every call of processBlock(for having allways the same frequency, I considered the blocksize (numSamples)…) :

     	filter.makeLowPass (theSampleRate, newCutoff);
     	filter.processSamples  (channelData, numSamples); 

result => crackling, i gues due to the fact, u get a step Function by changing the cutOff only every time processBlock is been called.

  1. like 1) but with lowpassed newCutoff values
    result => little better than 1) but still i’ve got cracklings.

  2. load the values for the VCF in a buffer and process pass this buffer to another function, which is processing a lowpass for every value of the oscillator

     for (int i=0; i<numSamples-1; i++)
     		float* ptr = valuesForVCF.getSampleData (0, i);
     		makeLowPass (sampleRate, *ptr);
     		processSingleSampleRaw (*samples);

(btw processSingleSampleRaw is not working when I try to use it. so I store 2 values and process them with processSamples. But i decided to post the code with processSingleSampleRaw it is easyer to understand…)

result => cool VCF with … ahhhhh crackling!

where am I wrong ???

thanks a lot! for helping.


Have a look at my IIR filters library, it specifically address your use-case (time-varying filter parameters)


You want a “SmoothedFilter”



thanks, your libary seems to be very impressive!
i think your approach is to interpolate new values for the lp for every sample.
is there a difference between calculate (my approach) and interpolate(your approach), so this is why my version is crackling?

Is there maybe a juce-based approach for my problem?

Some little hint like “put a lowpass between…” would be cool 8) ?


The daft mistake that I normally make when doing this kind of thing is to only have one filter, and then more than one input channel through that same filter…


hmm I know this mistake (from myself…) too, but in this case I considered it…

so any other ideas?

or is this two hard to get solved in one or two days?

then I will try to implemente TheVinns libary …


yeeeeeeaha got it.

I put the VCF in my oscillator class and now i process every single sample in this class…

and i’ve got noooo crackling.

Thanks for ur tips,

greetz equinox