JUCE: dsp::LadderFilter< Type > Class Template Reference

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.

## ◆ setMode()

template<typename Type >

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

Sets filter mode.

## ◆ prepare()

template<typename Type >

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

Initialises the filter.

## ◆ getNumChannels()

template<typename Type >

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

Returns the current number of channels.

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

## ◆ reset()

template<typename Type >

void dsp::LadderFilter< Type >::reset | ( |  | ) |
| noexcept

Resets the internal state variables of the filter.

## ◆ setCutoffFrequencyHz()

template<typename Type >

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

Sets the cutoff frequency of the filter.

Parameters

  newValue | cutoff frequency in Hz

## ◆ setResonance()

template<typename Type >

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

Sets the resonance of the filter.

Parameters

  newValue | a value between 0 and 1; higher values increase the resonance and can result in self oscillation!

## ◆ setDrive()

template<typename Type >

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

Sets the amount of saturation in the filter.

Parameters

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

## ◆ process()

template<typename Type >
template<typename ProcessContext >

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

References dsp::LadderFilter< Type >::getNumChannels(), jassert, dsp::LadderFilter< Type >::processSample(), and dsp::LadderFilter< Type >::updateSmoothers().

## ◆ processSample()

template<typename Type >

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

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

## ◆ updateSmoothers()

template<typename Type >

void dsp::LadderFilter< Type >::updateSmoothers | ( |  | ) |
| protectednoexcept

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

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

- juce_LadderFilter.h