Class daisysp::Compressor¶
ClassList > daisysp > Compressor
#include <compressor.h>
Public Functions¶
| Type | Name |
|---|---|
| float | Apply (float in) |
| void | AutoMakeup (bool enable) |
| Compressor () |
|
| float | GetAttack () |
| float | GetGain () |
| float | GetMakeup () |
| float | GetRatio () |
| float | GetRelease () |
| float | GetThreshold () |
| void | Init (float sample_rate) |
| float | Process (float in) |
| float | Process (float in, float key) |
| 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) |
| void | SetAttack (float attack) |
| void | SetMakeup (float gain) |
| void | SetRatio (float ratio) |
| void | SetRelease (float release) |
| void | SetThreshold (float threshold) |
| ~Compressor () |
Detailed Description¶
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
Todo
Add soft/hard knee settings
Public Functions Documentation¶
function Apply¶
Apply compression to the audio signal, based on the previously calculated gain
Parameters:
inaudio input signal
function AutoMakeup¶
Enables or disables the automatic makeup gain. Disabling sets the makeup gain to 0.0
Parameters:
enabletrue to enable, false to disable
function Compressor¶
function GetAttack¶
Gets the envelope time for onset of compression
function GetGain¶
Gets the gain reduction in dB
function GetMakeup¶
Gets the additional gain to make up for the compression
function GetRatio¶
Gets the amount of gain reduction
function GetRelease¶
Gets the envelope time for release of compression
function GetThreshold¶
Gets the threshold in dB
function Init¶
Initializes compressor
Parameters:
sample_raterate at which samples will be produced by the audio engine.
function Process [½]¶
Compress the audio input signal, saves the calculated gain
Parameters:
inaudio input signal
function Process [2/2]¶
Compresses the audio input signal, keyed by a secondary input.
Parameters:
inaudio input signal (to be compressed)keyaudio input that will be used to side-chain the compressor
function ProcessBlock [⅓]¶
Compresses a block of audio
Parameters:
inaudio input signaloutaudio output signalsizethe size of the block
function ProcessBlock [⅔]¶
Compresses a block of audio, keyed by a secondary input
Parameters:
inaudio input signal (to be compressed)outaudio output signalkeyaudio input that will be used to side-chain the compressorsizethe size of the block
function ProcessBlock [3/3]¶
void daisysp::Compressor::ProcessBlock (
float ** in,
float ** out,
float * key,
size_t channels,
size_t size
)
Compresses a block of multiple channels of audio, keyed by a secondary input
Parameters:
inaudio input signals (to be compressed)outaudio output signalskeyaudio input that will be used to side-chain the compressorchannelsthe number of audio channelssizethe size of the block
function SetAttack¶
Sets the envelope time for onset of compression for signals above the threshold.
Parameters:
attackExpects 0.001 -> 10
function SetMakeup¶
Manually sets the additional gain to make up for the compression
Parameters:
gainExpects 0.0 -> 80
function SetRatio¶
Sets the amount of gain reduction applied to compressed signals
Parameters:
ratioExpects 1.0 -> 40. (untested with values < 1.0)
function SetRelease¶
Sets the envelope time for release of compression as input signal falls below threshold.
Parameters:
releaseExpects 0.001 -> 10
function SetThreshold¶
Sets the threshold in dB at which compression will be applied
Parameters:
thresholdExpects 0.0 -> -80.
function ~Compressor¶
The documentation for this class was generated from the following file external-docs/DaisySP/DaisySP-LGPL/Source/Dynamics/compressor.h