Multi-mode filter based on the Moog ladder filter. More...
#include <juce_LadderFilter.h>
Public Types | |
enum | Mode { Mode::LPF12, Mode::HPF12, Mode::LPF24, Mode::HPF24 } |
Public Member Functions | |
LadderFilter () | |
Creates an uninitialised filter. More... | |
size_t | getNumChannels () const noexcept |
Returns the current number of channels. More... | |
void | prepare (const juce::dsp::ProcessSpec &spec) |
Initialises the filter. More... | |
template<typename ProcessContext > | |
void | process (const ProcessContext &context) noexcept |
void | reset () noexcept |
Resets the internal state variables of the filter. More... | |
void | setCutoffFrequencyHz (Type newValue) noexcept |
Sets the cutoff frequency of the filter. More... | |
void | setDrive (Type newValue) noexcept |
Sets the amound of saturation in the filter. More... | |
void | setEnabled (bool newValue) noexcept |
Enables or disables the filter. More... | |
void | setMode (Mode newValue) noexcept |
Sets filter mode. More... | |
void | setResonance (Type newValue) noexcept |
Sets the resonance of the filter. More... | |
Protected Member Functions | |
Type | processSample (Type inputValue, size_t channelToUse) noexcept |
void | updateSmoothers () noexcept |
Private Member Functions | |
void | setNumChannels (size_t newValue) |
void | setSampleRate (Type newValue) noexcept |
void | updateCutoffFreq () noexcept |
void | updateResonance () noexcept |
Private Attributes | |
std::array< Type, numStates > | A |
Type | comp |
Type | cutoffFreqHz { Type (200) } |
Type | cutoffFreqScaler |
LinearSmoothedValue< Type > | cutoffTransformSmoother |
Type | cutoffTransformValue |
Type | drive |
Type | drive2 |
bool | enabled = true |
Type | gain |
Type | gain2 |
Mode | mode |
Type | resonance |
LookupTableTransform< Type > | saturationLUT { [] (Type x) { return std::tanh (x); }, Type (-5), Type (5), 128 } |
LinearSmoothedValue< Type > | scaledResonanceSmoother |
Type | scaledResonanceValue |
std::vector< std::array< Type, numStates > > | state |
Static Private Attributes | |
static constexpr size_t | numStates = 5 |
Multi-mode filter based on the Moog ladder filter.
{DSP}
|
strong |
juce::dsp::LadderFilter< Type >::LadderFilter | ( | ) |
Creates an uninitialised filter.
Call prepare() before first use.
|
inlinenoexcept |
Returns the current number of channels.
References juce::dsp::LadderFilter< Type >::reset(), juce::dsp::LadderFilter< Type >::setCutoffFrequencyHz(), juce::dsp::LadderFilter< Type >::setDrive(), juce::dsp::LadderFilter< Type >::setResonance(), and juce::dsp::LadderFilter< Type >::state.
Referenced by juce::dsp::LadderFilter< Type >::process().
void juce::dsp::LadderFilter< Type >::prepare | ( | const juce::dsp::ProcessSpec & | spec | ) |
Initialises the filter.
Referenced by juce::dsp::LadderFilter< Type >::setEnabled().
|
inlinenoexcept |
|
protectednoexcept |
Referenced by juce::dsp::LadderFilter< Type >::process().
|
noexcept |
Resets the internal state variables of the filter.
Referenced by juce::dsp::LadderFilter< Type >::getNumChannels().
|
noexcept |
Sets the cutoff frequency of the filter.
newValue | cutoff frequency in Hz |
Referenced by juce::dsp::LadderFilter< Type >::getNumChannels().
|
noexcept |
Sets the amound of saturation in the filter.
newValue | saturation amount; it can be any number greater than or equal to one. Higher values result in more distortion. |
Referenced by juce::dsp::LadderFilter< Type >::getNumChannels().
|
inlinenoexcept |
Enables or disables the filter.
If disabled it will simply pass through the input signal.
References juce::dsp::LadderFilter< Type >::enabled, juce::dsp::LadderFilter< Type >::prepare(), and juce::dsp::LadderFilter< Type >::setMode().
|
noexcept |
Sets filter mode.
Referenced by juce::dsp::LadderFilter< Type >::setEnabled().
|
inlineprivate |
|
noexcept |
Sets the resonance of the filter.
newValue | a value between 0 and 1; higher values increase the resonance and can result in self oscillation! |
Referenced by juce::dsp::LadderFilter< Type >::getNumChannels().
|
privatenoexcept |
|
inlineprivatenoexcept |
|
inlineprivatenoexcept |
References juce::jmap(), and juce::LinearSmoothedValue< FloatType >::setValue().
|
protectednoexcept |
Referenced by juce::dsp::LadderFilter< Type >::process().
|
private |
|
private |
|
private |
Referenced by juce::dsp::LadderFilter< Type >::updateCutoffFreq().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
Referenced by juce::dsp::LadderFilter< Type >::getNumChannels().