Compressor Sidechain#
Sidechain compressor Stages use the envelope of one input to control the level of a different input.
- class audio_dsp.stages.compressor_sidechain.CompressorSidechain(**kwargs)
An sidechain compressor based on the RMS envelope of the detect signal.
This stage is limited to accepting 2 channels. The first is the channel that will be compressed. The second is the detect channel. The level of compression depends on the envelope of the second channel.
When the RMS envelope of the detect signal exceeds the threshold, the processed signal amplitude is reduced by the compression ratio.
The threshold sets the value above which compression occurs. The ratio sets how much the signal is compressed. A ratio of 1 results in no compression, while a ratio of infinity results in the same behaviour as a limiter. The attack time sets how fast the compressor starts compressing. The release time sets how long the signal takes to ramp up to its original level after the envelope is below the threshold.
- Attributes:
- dsp_block
audio_dsp.dsp.drc.sidechain.compressor_rms_sidechain_mono
The DSP block class; see Sidechain RMS Compressor for implementation details.
- dsp_block
- make_compressor_sidechain(ratio, threshold_db, attack_t, release_t, Q_sig=27)
Update compressor configuration based on new parameters.
- Parameters:
- ratiofloat
Compression gain ratio applied when the signal is above the threshold.
- threshold_dbfloat
Threshold in decibels above which compression occurs.
- attack_tfloat
Attack time of the compressor in seconds.
- release_tfloat
Release time of the compressor in seconds.
CompressorSidechain Control#
The following runtime command ids are available for the CompressorSidechain Stage. For details on reading and writing these commands, see the Run-Time Control User Guide.
Control parameter |
Payload length |
---|---|
CMD_COMPRESSOR_SIDECHAIN_ATTACK_ALPHA |
|
The attack alpha in Q0.31 format. To convert an attack time in seconds to an |
|
CMD_COMPRESSOR_SIDECHAIN_RELEASE_ALPHA |
|
The release alpha in Q0.31 format. To convert a release time in seconds to an |
|
CMD_COMPRESSOR_SIDECHAIN_ENVELOPE |
|
The current RMS² envelope of the signal in Q_SIG format. To read the |
|
CMD_COMPRESSOR_SIDECHAIN_THRESHOLD |
|
The threshold in Q_SIG format above which compression will occur. To convert a threshold in dB to the |
|
CMD_COMPRESSOR_SIDECHAIN_GAIN |
|
The current gain applied by the compressor in Q0.31 format. To read the |
|
CMD_COMPRESSOR_SIDECHAIN_SLOPE |
|
The compression slope of the compressor. This is calculated as (1 - 1 / ratio) / 2.0. To convert a ratio to a slope, use the function |