I’ve been eager to mess around with the StateVariableTPTFilter, specifically as a component in a low pass gate plugin that I’m developing. I have several questions regarding cutoff modulation which I have had no luck finding answers to either in the JUCE forums, JUCE tutorials, on google, or in any github example searches.
Some brief context on my project before I get to my questions:
- I’m using JUCE 6.0.8
- I’m developing a stereo plugin which can perform either operation depending on the derivative of the signal’s amplitude: (A) Modulate a lowpass filter’s cutoff from its current value (a minimum of 20Hz) to 16KHz in 12 milliseconds [when the amplitude is increasing]. OR (B) modulate a lowpass filter’s cutoff from its current value (with a maximum of 16KHz) to 20Hz in 250 milliseconds [when the amplitude is decreasing].
- The “amplitude” controlling the LPF cutoff frequency is in reality a sidechain signal derived from the input signal via something equivalent to: abs(max(leftSample, rightSample)), so the LPF cutoff frequency is not exactly channel-specific per-se.
Enough with the project background, here are my questions:
Are there any examples you can point me to where people use the StateVariableTPTFilter for fast cutoff frequency modulation? All the examples I’ve found are using DIY dsp code, rather than JUCE’s recent dsp code.
The JUCE documentation states that the StateVariableTPTFilter is designed for fast modulation of cutoff frequencies, which is exactly what I’m looking for – but what is the best practice for how frequently you should be updating a StateVariableTPTFilter instance’s cutoff? Should I only update the cutoff frequency once per block? Once per sample? Something else? (keep in mind the time constraints I’m aiming for regarding filter sweeps – 12ms essentially being the fastest I’d sweep the cutoff).
How fast can the StateVariableTPTFilter modulate its cutoff between two frequencies? Is there a way to control the speed of that cutoff modulation?
Should I be using a multiplicative smoothedvalue if I want to control how long it takes for a cutoff frequency shift to take place, or is the smoothing handled under the StateVariableTPTFilter’s hood?
I’ve looked at the DSP tutorial and they mention the RenderNextBlock method, which seems possibly like the appropriate thing to use in my plugin. Am I mistaken in thinking that method should be used for my specific needs? If I’m not mistaken, how and when does that specific method get called?
Thanks in advance. Apologies for not providing some code snippets, but I don’t have much to share while I figure out the proper way to handle cutoff frequency modulation.