JUCE
Public Types | Public Member Functions | Protected Member Functions | List of all members
dsp::LadderFilter< Type > Class Template Reference

Multi-mode filter based on the Moog ladder filter. More...

Public Types

enum  Mode { Mode::LPF12, Mode::HPF12, Mode::LPF24, Mode::HPF24 }
 

Public Member Functions

 LadderFilter ()
 Creates an uninitialised filter. More...
 
void setEnabled (bool newValue) noexcept
 Enables or disables the filter. More...
 
void setMode (Mode newValue) noexcept
 Sets filter mode. More...
 
void prepare (const juce::dsp::ProcessSpec &spec)
 Initialises the filter. More...
 
size_t getNumChannels () const noexcept
 Returns the current number of channels. More...
 
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 setResonance (Type newValue) noexcept
 Sets the resonance of the filter. More...
 
void setDrive (Type newValue) noexcept
 Sets the amount of saturation in the filter. More...
 
template<typename ProcessContext >
void process (const ProcessContext &context) noexcept
 

Protected Member Functions

Type processSample (Type inputValue, size_t channelToUse) noexcept
 
void updateSmoothers () noexcept
 

Detailed Description

template<typename Type>
class dsp::LadderFilter< Type >

Multi-mode filter based on the Moog ladder filter.

Member Enumeration Documentation

◆ Mode

template<typename Type >
enum dsp::LadderFilter::Mode
strong
Enumerator
LPF12 
HPF12 
LPF24 
HPF24 

Constructor & Destructor Documentation

◆ LadderFilter()

template<typename Type >
dsp::LadderFilter< Type >::LadderFilter ( )

Creates an uninitialised filter.

Call prepare() before first use.

Member Function Documentation

◆ setEnabled()

template<typename Type >
void dsp::LadderFilter< Type >::setEnabled ( bool  newValue)
noexcept

Enables or disables the filter.

If disabled it will simply pass through the input signal.

References dsp::LadderFilter< Type >::prepare(), and dsp::LadderFilter< Type >::setMode().

◆ setMode()

template<typename Type >
void dsp::LadderFilter< Type >::setMode ( Mode  newValue)
noexcept

Sets filter mode.

Referenced by dsp::LadderFilter< Type >::setEnabled().

◆ prepare()

template<typename Type >
void dsp::LadderFilter< Type >::prepare ( const juce::dsp::ProcessSpec &  spec)

Initialises the filter.

Referenced by dsp::LadderFilter< Type >::setEnabled().

◆ getNumChannels()

template<typename Type >
size_t dsp::LadderFilter< Type >::getNumChannels ( ) const
noexcept

◆ reset()

template<typename Type >
void dsp::LadderFilter< Type >::reset ( )
noexcept

Resets the internal state variables of the filter.

Referenced by dsp::LadderFilter< Type >::getNumChannels().

◆ setCutoffFrequencyHz()

template<typename Type >
void dsp::LadderFilter< Type >::setCutoffFrequencyHz ( Type  newValue)
noexcept

Sets the cutoff frequency of the filter.

Parameters
newValuecutoff frequency in Hz

Referenced by dsp::LadderFilter< Type >::getNumChannels().

◆ setResonance()

template<typename Type >
void dsp::LadderFilter< Type >::setResonance ( Type  newValue)
noexcept

Sets the resonance of the filter.

Parameters
newValuea value between 0 and 1; higher values increase the resonance and can result in self oscillation!

Referenced by dsp::LadderFilter< Type >::getNumChannels().

◆ setDrive()

template<typename Type >
void dsp::LadderFilter< Type >::setDrive ( Type  newValue)
noexcept

Sets the amount of saturation in the filter.

Parameters
newValuesaturation amount; it can be any number greater than or equal to one. Higher values result in more distortion.

Referenced by dsp::LadderFilter< Type >::getNumChannels().

◆ process()

template<typename Type >
template<typename ProcessContext >
void dsp::LadderFilter< Type >::process ( const ProcessContext &  context)
noexcept

◆ processSample()

template<typename Type >
Type dsp::LadderFilter< Type >::processSample ( Type  inputValue,
size_t  channelToUse 
)
protectednoexcept

◆ updateSmoothers()

template<typename Type >
void dsp::LadderFilter< Type >::updateSmoothers ( )
protectednoexcept

The documentation for this class was generated from the following file: