daisysp::Compressor¶
#include <compressor.h>
Public Functions¶
Name | |
---|---|
Compressor() | |
~Compressor() | |
void | Init(float sample_rate) |
float | Process(float in) |
float | Process(float in, float key) |
float | Apply(float in) |
void | ProcessBlock(float * in, float * out, size_t size) |
void | ProcessBlock(float * in, float * out, float * key, size_t size) |
void | ProcessBlock(float ** in, float ** out, float * key, size_t channels, size_t size) |
float | GetRatio() |
void | SetRatio(float ratio) |
float | GetThreshold() |
void | SetThreshold(float threshold) |
float | GetAttack() |
void | SetAttack(float attack) |
float | GetRelease() |
void | SetRelease(float release) |
float | GetMakeup() |
void | SetMakeup(float gain) |
void | AutoMakeup(bool enable) |
float | GetGain() |
Detailed Description¶
Todo: Add soft/hard knee settings
dynamics compressor
influenced by compressor in soundpipe (from faust).
Modifications made to do:
- Less calculations during each process loop (coefficients recalculated on parameter change).
- C++-ified
- added sidechain support
- pulled gain apart for monitoring and multichannel support
- improved readability
- improved makeup-gain calculations
- changing controls now costs a lot less
- a lot less expensive
by: shensley, improved upon by AvAars
Public Functions Documentation¶
function Compressor¶
function ~Compressor¶
function Init¶
Parameters:
- sample_rate rate at which samples will be produced by the audio engine.
Initializes compressor
function Process¶
Parameters:
- in audio input signal
Compress the audio input signal, saves the calculated gain
function Process¶
Parameters:
- in audio input signal (to be compressed)
- key audio input that will be used to side-chain the compressor
Compresses the audio input signal, keyed by a secondary input.
function Apply¶
Parameters:
- in audio input signal
Apply compression to the audio signal, based on the previously calculated gain
function ProcessBlock¶
Parameters:
- in audio input signal
- out audio output signal
- size the size of the block
Compresses a block of audio
function ProcessBlock¶
Parameters:
- in audio input signal (to be compressed)
- out audio output signal
- key audio input that will be used to side-chain the compressor
- size the size of the block
Compresses a block of audio, keyed by a secondary input
function ProcessBlock¶
Parameters:
- in audio input signals (to be compressed)
- out audio output signals
- key audio input that will be used to side-chain the compressor
- channels the number of audio channels
- size the size of the block
Compresses a block of multiple channels of audio, keyed by a secondary input
function GetRatio¶
Gets the amount of gain reduction
function SetRatio¶
Parameters:
- ratio Expects 1.0 -> 40. (untested with values < 1.0)
Sets the amount of gain reduction applied to compressed signals
function GetThreshold¶
Gets the threshold in dB
function SetThreshold¶
Parameters:
- threshold Expects 0.0 -> -80.
Sets the threshold in dB at which compression will be applied
function GetAttack¶
Gets the envelope time for onset of compression
function SetAttack¶
Parameters:
- attack Expects 0.001 -> 10
Sets the envelope time for onset of compression for signals above the threshold.
function GetRelease¶
Gets the envelope time for release of compression
function SetRelease¶
Parameters:
- release Expects 0.001 -> 10
Sets the envelope time for release of compression as input signal falls below threshold.
function GetMakeup¶
Gets the additional gain to make up for the compression
function SetMakeup¶
Parameters:
- gain Expects 0.0 -> 80
Manually sets the additional gain to make up for the compression
function AutoMakeup¶
Parameters:
- enable true to enable, false to disable
Enables or disables the automatic makeup gain. Disabling sets the makeup gain to 0.0
function GetGain¶
Gets the gain reduction in dB
---¶
Updated on 2024-01-03 at 19:38:46 +0000