Multi-mode filter based on the Moog ladder filter. More...
#include <juce_LadderFilter.h>
Public Types | |
using | Mode = LadderFilterMode |
Public Member Functions | |
LadderFilter () | |
Creates an uninitialised filter. More... | |
size_t | getNumChannels () const noexcept |
Returns the current number of channels. More... | |
void | prepare (const 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 (SampleType newCutoff) noexcept |
Sets the cutoff frequency of the filter. More... | |
void | setDrive (SampleType newDrive) noexcept |
Sets the amount of saturation in the filter. More... | |
void | setEnabled (bool isEnabled) noexcept |
Enables or disables the filter. More... | |
void | setMode (Mode newMode) noexcept |
Sets filter mode. More... | |
void | setResonance (SampleType newResonance) noexcept |
Sets the resonance of the filter. More... | |
Protected Member Functions | |
SampleType | processSample (SampleType inputValue, size_t channelToUse) noexcept |
void | updateSmoothers () noexcept |
Private Member Functions | |
void | setNumChannels (size_t newValue) |
void | setSampleRate (SampleType newValue) noexcept |
void | updateCutoffFreq () noexcept |
void | updateResonance () noexcept |
Private Attributes | |
std::array< SampleType, numStates > | A |
SampleType | comp |
SampleType | cutoffFreqHz { SampleType (200) } |
SampleType | cutoffFreqScaler |
SmoothedValue< SampleType > | cutoffTransformSmoother |
SampleType | cutoffTransformValue |
SampleType | drive |
SampleType | drive2 |
bool | enabled = true |
SampleType | gain |
SampleType | gain2 |
Mode | mode |
SampleType | resonance |
LookupTableTransform< SampleType > | saturationLUT |
SmoothedValue< SampleType > | scaledResonanceSmoother |
SampleType | scaledResonanceValue |
std::vector< std::array< SampleType, numStates > > | state |
Static Private Attributes | |
static constexpr size_t | numStates = 5 |
Multi-mode filter based on the Moog ladder filter.
@tags{DSP}
using juce::dsp::LadderFilter< SampleType >::Mode = LadderFilterMode |
juce::dsp::LadderFilter< SampleType >::LadderFilter | ( | ) |
Creates an uninitialised filter.
Call prepare() before first use.
|
inlinenoexcept |
Returns the current number of channels.
References juce::dsp::LadderFilter< SampleType >::state.
Referenced by juce::dsp::LadderFilter< SampleType >::process().
void juce::dsp::LadderFilter< SampleType >::prepare | ( | const ProcessSpec & | spec | ) |
Initialises the filter.
|
inlinenoexcept |
|
protectednoexcept |
Referenced by juce::dsp::LadderFilter< SampleType >::process().
|
noexcept |
Resets the internal state variables of the filter.
|
noexcept |
Sets the cutoff frequency of the filter.
newCutoff | cutoff frequency in Hz |
|
noexcept |
Sets the amount of saturation in the filter.
newDrive | saturation amount; it can be any number greater than or equal to one. Higher values result in more distortion. |
|
inlinenoexcept |
Enables or disables the filter.
If disabled it will simply pass through the input signal.
References juce::dsp::LadderFilter< SampleType >::enabled.
|
noexcept |
Sets filter mode.
|
inlineprivate |
References juce::dsp::LadderFilter< SampleType >::state.
|
noexcept |
Sets the resonance of the filter.
newResonance | a value between 0 and 1; higher values increase the resonance and can result in self oscillation! |
|
privatenoexcept |
|
inlineprivatenoexcept |
|
inlineprivatenoexcept |
|
protectednoexcept |
Referenced by juce::dsp::LadderFilter< SampleType >::process().
|
private |
|
private |
|
private |
Referenced by juce::dsp::LadderFilter< SampleType >::updateCutoffFreq().
|
private |
Referenced by juce::dsp::LadderFilter< SampleType >::updateCutoffFreq().
|
private |
Referenced by juce::dsp::LadderFilter< SampleType >::updateCutoffFreq().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticconstexprprivate |
|
private |
Referenced by juce::dsp::LadderFilter< SampleType >::updateResonance().
|
private |
|
private |
Referenced by juce::dsp::LadderFilter< SampleType >::updateResonance().
|
private |
|
private |