Loading...
Searching...
No Matches
juce::dsp::BallisticsFilter< SampleType > Class Template Reference

`#include <juce_BallisticsFilter.h>`

## Public Types

using | LevelCalculationType = BallisticsFilterLevelCalculationType

## Public Member Functions

| BallisticsFilter ()
void | setAttackTime (SampleType attackTimeMs)
void | setReleaseTime (SampleType releaseTimeMs)
void | setLevelCalculationType (LevelCalculationType newCalculationType)
void | prepare (const ProcessSpec &spec)
void | reset ()
void | reset (SampleType initialValue)
template<typename ProcessContext>
void | process (const ProcessContext &context) noexcept
SampleType | processSample (int channel, SampleType inputValue)
void | snapToZero () noexcept

## Detailed Description

template<typename SampleType>
class juce::dsp::BallisticsFilter< SampleType >

A processor to apply standard attack / release ballistics to an input signal. This is useful in dynamics processors, envelope followers, modulated audio effects and for smoothing animation in data visualisation.

Definition at line 43 of file juce_BallisticsFilter.h.

## Member Typedef Documentation

## LevelCalculationType

template<typename SampleType>

using juce::dsp::BallisticsFilter< SampleType >::LevelCalculationType = BallisticsFilterLevelCalculationType

Definition at line 47 of file juce_BallisticsFilter.h.

## Constructor & Destructor Documentation

## BallisticsFilter()

template<typename SampleType>

juce::dsp::BallisticsFilter< SampleType >::BallisticsFilter | ( |  | ) |

Constructor.

Definition at line 31 of file juce_BallisticsFilter.cpp.

## Member Function Documentation

## prepare()

template<typename SampleType>

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

Initialises the filter.

Definition at line 59 of file juce_BallisticsFilter.cpp.

## process()

template<typename SampleType>
template<typename ProcessContext>

void juce::dsp::BallisticsFilter< SampleType >::process | ( | const ProcessContext & | context | ) |

inline noexcept

Processes the input and output samples supplied in the processing context.

Definition at line 96 of file juce_BallisticsFilter.h.

## processSample()

template<typename SampleType>

SampleType juce::dsp::BallisticsFilter< SampleType >::processSample | ( | int | channel,
|  | SampleType | inputValue )

Processes one sample at a time on a given channel.

Definition at line 89 of file juce_BallisticsFilter.cpp.

Referenced by process().

## reset() [1/2]

template<typename SampleType>

void juce::dsp::BallisticsFilter< SampleType >::reset | ( |  | ) |

Resets the internal state variables of the filter.

Definition at line 76 of file juce_BallisticsFilter.cpp.

Referenced by prepare(), reset(), and setLevelCalculationType().

## reset() [2/2]

template<typename SampleType>

void juce::dsp::BallisticsFilter< SampleType >::reset | ( | SampleType | initialValue | ) |

Resets the internal state variables of the filter to the given initial value.

Definition at line 82 of file juce_BallisticsFilter.cpp.

## setAttackTime()

template<typename SampleType>

void juce::dsp::BallisticsFilter< SampleType >::setAttackTime | ( | SampleType | attackTimeMs | ) |

Sets the attack time in ms.

Attack times less than 0.001 ms will be snapped to zero and very long attack times will eventually saturate depending on the numerical precision used.

Definition at line 38 of file juce_BallisticsFilter.cpp.

Referenced by BallisticsFilter(), and prepare().

## setLevelCalculationType()

template<typename SampleType>

void juce::dsp::BallisticsFilter< SampleType >::setLevelCalculationType | ( | LevelCalculationType | newCalculationType | ) |

Sets how the filter levels are calculated.

Level calculation in digital envelope followers is usually performed using peak detection with a rectifier function (like std::abs) and filtering, which returns an envelope dependant on the peak or maximum values of the signal amplitude.

To perform an estimation of the average value of the signal you can use an RMS (root mean squared) implementation of the ballistics filter instead. This is useful in some compressor and noise-gate designs, or in specific types of volume meters.

Definition at line 52 of file juce_BallisticsFilter.cpp.

## setReleaseTime()

template<typename SampleType>

void juce::dsp::BallisticsFilter< SampleType >::setReleaseTime | ( | SampleType | releaseTimeMs | ) |

Sets the release time in ms.

Release times less than 0.001 ms will be snapped to zero and very long release times will eventually saturate depending on the numerical precision used.

Definition at line 45 of file juce_BallisticsFilter.cpp.

Referenced by BallisticsFilter(), and prepare().

## snapToZero()

template<typename SampleType>

void juce::dsp::BallisticsFilter< SampleType >::snapToZero | ( |  | ) |

noexcept

Ensure that the state variables are rounded to zero if the state variables are denormals. This is only needed if you are doing sample by sample processing.

Definition at line 110 of file juce_BallisticsFilter.cpp.

Referenced by process().

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

- juce_BallisticsFilter.h
- juce_BallisticsFilter.cpp