JUCE  v6.1.6 (6.0.8-1114)
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::dsp::Compressor< SampleType > Class Template Reference

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

#include <juce_Compressor.h>

Collaboration diagram for juce::dsp::Compressor< SampleType >:

Public Member Functions

 Compressor ()
 Constructor. More...
 
void prepare (const ProcessSpec &spec)
 Initialises 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...
 
void reset ()
 Resets the internal state variables of the processor. More...
 
void setAttack (SampleType newAttack)
 Sets the attack time in milliseconds of the compressor. More...
 
void setRatio (SampleType newRatio)
 Sets the ratio of the compressor (must be higher or equal to 1). More...
 
void setRelease (SampleType newRelease)
 Sets the release time in milliseconds of the compressor. More...
 
void setThreshold (SampleType newThreshold)
 Sets the threshold in dB of the compressor. More...
 

Private Member Functions

void update ()
 

Private Attributes

SampleType attackTime = 1.0
 
BallisticsFilter< SampleType > envelopeFilter
 
SampleType ratio = 1.0
 
SampleType ratioInverse
 
SampleType releaseTime = 100.0
 
double sampleRate = 44100.0
 
SampleType threshold
 
SampleType thresholddB = 0.0
 
SampleType thresholdInverse
 

Detailed Description

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

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

@tags{DSP}

Constructor & Destructor Documentation

◆ Compressor()

template<typename SampleType >
juce::dsp::Compressor< SampleType >::Compressor ( )

Constructor.

Member Function Documentation

◆ prepare()

template<typename SampleType >
void juce::dsp::Compressor< SampleType >::prepare ( const ProcessSpec spec)

Initialises the processor.

◆ process()

template<typename SampleType >
template<typename ProcessContext >
void juce::dsp::Compressor< SampleType >::process ( const ProcessContext context)
inlinenoexcept

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

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

◆ processSample()

template<typename SampleType >
SampleType juce::dsp::Compressor< SampleType >::processSample ( int  channel,
SampleType  inputValue 
)

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

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

◆ reset()

template<typename SampleType >
void juce::dsp::Compressor< SampleType >::reset ( )

Resets the internal state variables of the processor.

◆ setAttack()

template<typename SampleType >
void juce::dsp::Compressor< SampleType >::setAttack ( SampleType  newAttack)

Sets the attack time in milliseconds of the compressor.

◆ setRatio()

template<typename SampleType >
void juce::dsp::Compressor< SampleType >::setRatio ( SampleType  newRatio)

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

◆ setRelease()

template<typename SampleType >
void juce::dsp::Compressor< SampleType >::setRelease ( SampleType  newRelease)

Sets the release time in milliseconds of the compressor.

◆ setThreshold()

template<typename SampleType >
void juce::dsp::Compressor< SampleType >::setThreshold ( SampleType  newThreshold)

Sets the threshold in dB of the compressor.

◆ update()

template<typename SampleType >
void juce::dsp::Compressor< SampleType >::update ( )
private

Member Data Documentation

◆ attackTime

template<typename SampleType >
SampleType juce::dsp::Compressor< SampleType >::attackTime = 1.0
private

◆ envelopeFilter

template<typename SampleType >
BallisticsFilter<SampleType> juce::dsp::Compressor< SampleType >::envelopeFilter
private

◆ ratio

template<typename SampleType >
SampleType juce::dsp::Compressor< SampleType >::ratio = 1.0
private

◆ ratioInverse

template<typename SampleType >
SampleType juce::dsp::Compressor< SampleType >::ratioInverse
private

◆ releaseTime

template<typename SampleType >
SampleType juce::dsp::Compressor< SampleType >::releaseTime = 100.0
private

◆ sampleRate

template<typename SampleType >
double juce::dsp::Compressor< SampleType >::sampleRate = 44100.0
private

◆ threshold

template<typename SampleType >
SampleType juce::dsp::Compressor< SampleType >::threshold
private

◆ thresholddB

template<typename SampleType >
SampleType juce::dsp::Compressor< SampleType >::thresholddB = 0.0
private

◆ thresholdInverse

template<typename SampleType >
SampleType juce::dsp::Compressor< SampleType >::thresholdInverse
private

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