Hi guys,

I’m relatively new to JUCE and DSP. I’ve been playing with this State Variable Filter class: https://github.com/JordanTHarris/VAStateVariableFilter

It sounds pretty good, but I’d like to make a GUI component to show the filter response. I have no idea how to do it. Can anyone point me to the right direction?

Something like this:

I’ve found this project: https://github.com/JoshMarler/filter-gui-demo which works really well but it’s only for a one pole. I have no idea how to swap the transfer function to include a 2-pole lowpass from the State Variable Filter class.

This is the piece of code that needs to be changed, any help?

```
float getMagnitudeResponse(float frequency) const
{
float magnitude = 0.0;
float wd = 2 * M_PI * filterCutoff;
float T = 1/this->sampleRate;
//Calculating pre-warped/analogue cutoff frequency to use in virtual analogue frequeny response calculations
float cutOff = (2/T) * tan(wd*T/2);
//Digital frequency to evaluate
float wdEval = 2 * M_PI * frequency;
float sValue = (2/T) * tan(wdEval*T/2);
/* This is the digital transfer function which is equal to the analogue transfer function
evaluated at H(s) where s = (2/T) * tan(wd*T/2) hence why the cutoff used is the pre warped analogue equivalent.
See Art Of VA Filter Design 3.8 Bilinear Transform Section */
switch (filterType) {
case SVFLowpass:
//VA Lowpass Frequency response wc/s+wc
magnitude = cutOff/(sValue + cutOff);
break;
case SVFHighpass:
//VA Highpass Frequency response s/s+wc
magnitude = sValue/(sValue + cutOff);
break;
default:
break;
}
//Convert to db for log db response display
magnitude = Decibels::gainToDecibels(magnitude);
return magnitude;
}
```