|
Krotos Modules 3
|
Apply the Moog voltage controlled filter to an audio signal. More...
#include <MoogVcf.h>
Public Member Functions | |
| void | setUpFirst (double sampleRate, int) |
| setUpFirst | |
| float | getSr () |
| getSr() | |
| void | updateCutoff (float _f0) |
| updateCutoff | |
| void | updateResonance (float _r) |
| updateResonance | |
| float | process (float inputSampleNow, float inputSampleBefore) |
| process() | |
Private Attributes | |
| const float | initialF = 20.0f |
| float | m_sr |
| float | om0 = tau * initialF |
| Resonant filter frequency. | |
| float | om0New |
| float | r = 0.0f |
| Feedback coefficient. | |
| float | rNew |
| float | k |
| Time step. | |
| float | A0P |
| float | A0PNew |
| float | A0M |
| float | A1 |
| float | A1New |
| float | A3 |
| float | A3New |
| float | xf [4] = {0.0} |
Static Private Attributes | |
| static constexpr float | tau = 2.0f * 3.1415926535f |
Apply the Moog voltage controlled filter to an audio signal.
This class implements a virtual analogue model of the Moog VCF. The system of equations describing the state of the capacitors of the electrical circuit are solved for each input sample using the Trapezoid Integration Rule. The structure is modified to fit into the Kwidget technology. It is robust and computationally efficient.
TODO: Try and emulate the non linear version...
|
inline |
Returns the sampleRate value in float.
|
inline |
main filtering process - updates state and writes sample to output. For each input sample, the linear system of equations updates the values of the state vector xf and updates the parameters if they have been changed by the user.
| float | inputSampleNow: the current input sample from the buffer |
| float | inputSampleBefore: the former input sample from the buffer. |
|
inline |
setUpFirst
Sets up sampleRate and time step k . Gets called in the Processors prepare function.
| _sampleRate | |
| samplesPerBlock,not | used. |
|
inline |
updateCutoff
Sets filter cutoff and updates the state coefficients from the input parameter value. Gets called from the Processor's setCutoff function. To avoid loud high frequency - resonance amplitude spikes it performs a custom check and for certain cutoff - resonance pairs it readjusts the resonance, calling the updateResonace function.
| float | _f0 is the cutoff frequency in Hz parameter value |
|
inline |
updateResonance
Sets filter resonance and updates the state coefficients from the input parameter. Gets called from the Processor's setCutoff function. It also performs check for high frequency - resonance spikes.
| float | _r is the input resonance parameter value |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Time step.
|
private |
|
private |
|
private |
Feedback coefficient.
|
private |
|
staticconstexprprivate |
|
private |