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

JUCE

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

A simple compressor with standard threshold, ratio, attack time and release time controls. More...

`#include <juce_Compressor.h>`

## Public Member Functions
| Compressor ()
| Constructor. More...
void | setThreshold (SampleType newThreshold)
| Sets the threshold in dB of the compressor. More...
void | setRatio (SampleType newRatio)
| Sets the ratio of the compressor (must be higher or equal to 1). More...
void | setAttack (SampleType newAttack)
| Sets the attack time in milliseconds of the compressor. More...
void | setRelease (SampleType newRelease)
| Sets the release time in milliseconds of the compressor. More...
void | prepare (const ProcessSpec &spec)
| Initialises the processor. More...
void | reset ()
| Resets the internal state variables of the processor. More...
template<typename ProcessContext >
void | process (const ProcessContext &context) noexcept
| Processes the input and output samples supplied in the processing context. More...
SampleType | processSample (int channel, SampleType inputValue)
| Performs the processing operation on a single sample at a time. More...

## Detailed Description

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

A simple compressor with standard threshold, ratio, attack time and release time controls.

## Constructor & Destructor Documentation

## ◆ Compressor()

template<typename SampleType >

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

Constructor.

## Member Function Documentation

## ◆ setThreshold()

template<typename SampleType >

void dsp::Compressor< SampleType >::setThreshold | ( | SampleType | newThreshold | ) |

Sets the threshold in dB of the compressor.

## ◆ setRatio()

template<typename SampleType >

void dsp::Compressor< SampleType >::setRatio | ( | SampleType | newRatio | ) |

Sets the ratio of the compressor (must be higher or equal to 1).

## ◆ setAttack()

template<typename SampleType >

void dsp::Compressor< SampleType >::setAttack | ( | SampleType | newAttack | ) |

Sets the attack time in milliseconds of the compressor.

## ◆ setRelease()

template<typename SampleType >

void dsp::Compressor< SampleType >::setRelease | ( | SampleType | newRelease | ) |

Sets the release time in milliseconds of the compressor.

## ◆ prepare()

template<typename SampleType >

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

Initialises the processor.

## ◆ reset()

template<typename SampleType >

void dsp::Compressor< SampleType >::reset | ( |  | ) |

Resets the internal state variables of the processor.

## ◆ process()

template<typename SampleType >
template<typename ProcessContext >

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

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

References jassert, and dsp::Compressor< SampleType >::processSample().

## ◆ processSample()

template<typename SampleType >

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

Performs the processing operation on a single sample at a time.

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

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

- juce_Compressor.h