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

JUCE

Public Types | Public Member Functions | Protected Member Functions | List of all members
dsp::LadderFilter< SampleType > Class Template Reference
juce_dsp » widgets

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...
void | setEnabled (bool isEnabled) noexcept
| Enables or disables the filter. More...
void | setMode (Mode newMode) noexcept
| Sets filter mode. More...
void | prepare (const 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 (SampleType newCutoff) noexcept
| Sets the cutoff frequency of the filter. More...
void | setResonance (SampleType newResonance) noexcept
| Sets the resonance of the filter. More...
void | setDrive (SampleType newDrive) noexcept
| Sets the amount of saturation in the filter. More...
template<typename ProcessContext >
void | process (const ProcessContext &context) noexcept

## Protected Member Functions
SampleType | processSample (SampleType inputValue, size_t channelToUse) noexcept
void | updateSmoothers () noexcept

## Detailed Description

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

Multi-mode filter based on the Moog ladder filter.

## Member Typedef Documentation

## ◆ Mode

template<typename SampleType >

using dsp::LadderFilter< SampleType >::Mode = LadderFilterMode

## Constructor & Destructor Documentation

## ◆ LadderFilter()

template<typename SampleType >

dsp::LadderFilter< SampleType >::LadderFilter | ( |  | ) |

Creates an uninitialised filter.

Call prepare() before first use.

## Member Function Documentation

## ◆ setEnabled()

template<typename SampleType >

void dsp::LadderFilter< SampleType >::setEnabled | ( | bool | isEnabled | ) |
| noexcept

Enables or disables the filter.

If disabled it will simply pass through the input signal.

## ◆ setMode()

template<typename SampleType >

void dsp::LadderFilter< SampleType >::setMode | ( | Mode | newMode | ) |
| noexcept

Sets filter mode.

## ◆ prepare()

template<typename SampleType >

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

Initialises the filter.

## ◆ getNumChannels()

template<typename SampleType >

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

Returns the current number of channels.

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

## ◆ reset()

template<typename SampleType >

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

Resets the internal state variables of the filter.

## ◆ setCutoffFrequencyHz()

template<typename SampleType >

void dsp::LadderFilter< SampleType >::setCutoffFrequencyHz | ( | SampleType | newCutoff | ) |
| noexcept

Sets the cutoff frequency of the filter.

Parameters

  newCutoff | cutoff frequency in Hz

## ◆ setResonance()

template<typename SampleType >

void dsp::LadderFilter< SampleType >::setResonance | ( | SampleType | newResonance | ) |
| noexcept

Sets the resonance of the filter.

Parameters

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

## ◆ setDrive()

template<typename SampleType >

void dsp::LadderFilter< SampleType >::setDrive | ( | SampleType | newDrive | ) |
| noexcept

Sets the amount of saturation in the filter.

Parameters

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

## ◆ process()

template<typename SampleType >
template<typename ProcessContext >

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

References dsp::LadderFilter< SampleType >::getNumChannels(), jassert, gl::n, dsp::LadderFilter< SampleType >::processSample(), and dsp::LadderFilter< SampleType >::updateSmoothers().

## ◆ processSample()

template<typename SampleType >

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

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

## ◆ updateSmoothers()

template<typename SampleType >

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

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

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

- juce_LadderFilter.h