z1 needs to be a member variable of your LearningJuceAudioProcessor class. In your code z1 is local to the function so it gets reset to zero on each callback.
Hey buddy, I’m just skimming through this on a quick lunch break so I may be wrong but is it not because you aren’t saving the z1 delay elements state between process blocks ?
The unit delay (z1) goes out of scope with every call to processBlock which I think may be causing glitches.
Checkout a link here for a similar filter (one pole VA filter) that works in a demo plugin I whacked together and have still yet to finish because I was getting used to the new parameters system and then got side tracked with work and the joys of C# .Net web stuff…dull.
Have a look at VAOnePoleFilter.cpp and VAOnePoleFilter.h on the repo above for an idea of how the filter should work.
File above shows the filter being called in the processBlock.
Note you probably also want to have your unit z1 delay set up as a 2 channel delay. i.e z1[2] and use z1[channelNumber] in your process block to avoid glitches if your going to process the filter in stereo.
So maybe do that and ensure your maintaining the z1 delay state between process blocks (by having it as a member variable in either your filter class or PluginProcessor.h file/Class.
That should get you on the way.
Check the example link I posted.
I’ll take a quick look at this again for you tonight if that doesn’t work. Best be back to the C# !
The glitches are gone. But there’s is no filtering (just a volume attenuation).
By the way, the range of sliderVal is 0.0 to 0.49 (to prevent the filter blowing up)
Also the following book is very similar to Will Pirkle’s work with specific JUCE examples and written by two guys at QMUL so definitive worth a look:
Some of the parameter examples are a little out of date with the new JUCE classes but you should be able to translate it all across fairly easily. Feel free to drop me a message if you ever have any newbie questions.
I’m hoping to put together a few example plugins and other things when I finally get the time and may try to see if I can provide a tutorial on something in the future.