(8.D.2.7) Ducker
Overview
Duck or reduce the audio level of the input
Discussion
The module has the parameter "manualTrigger" to trigger manually. when the trigger signal or manualTrigger is nonzero, the level of the input audio will be changed from 1.0 to duckLevelLinear smoothly, with the time constant determined by the attackTime parameter. duckLevelLinear is the linear value equivalent to the dB value of duckLevel. After the time 3*attackTime + holdTime, the gain of the input audio changed to 1.0 smoothly, with the time constant determined by the releaseTime parameter.
Type Definition
typedef struct _ModuleDucker
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
FLOAT32 duckLevel; // Level in dB at which the input will be attenuated when ducking is active.
FLOAT32 attackTime; // Time constant in msec, which controls the ducking process.
FLOAT32 holdTime; // Time constant in msec which controls how long the signal is attenuated for.
FLOAT32 releaseTime; // Time constant in msec which controls how fast the gain is restored to 1.0.
INT32 manualTrigger; // Boolean parameter to trigger manually.
FLOAT32 duckLevelLinear; // Level in dB at which the input will be attenuated when ducking is active.
FLOAT32 attackCoeff; // Internal coefficient realizing the attack time.
FLOAT32 releaseCoeff; // Internal coefficient realizing the release time.
INT32 timerPeriod; // The period of timer in terms of number of blocks.
INT32 timerCount; // Instantaneous count of the timer.
FLOAT32 currentGain; // Instantaneous gain applied by the module.
FLOAT32 targetGain; // Target gain applied by the module.
FLOAT32 smoothingCoeff; // Internal coefficient realizing the smoothing time.
} ModuleDuckerClass;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
duckLevel | float | parameter | 0 | -20 | -60:0 | dB |
attackTime | float | parameter | 0 | 20 | 0.01:1000 | msec |
holdTime | float | parameter | 0 | 1000 | 0.01:1000 | msec |
releaseTime | float | parameter | 0 | 100 | 0.01:1000 | msec |
manualTrigger | int | parameter | 0 | 0 | 0:1 | Â |
duckLevelLinear | float | derived | 1 | 0.1 | Unrestricted | Â |
attackCoeff | float | derived | 1 | 0.001041 | Unrestricted | Â |
releaseCoeff | float | derived | 1 | 0.0002083 | Unrestricted | Â |
timerPeriod | int | derived | 1 | 1590 | Unrestricted | Â |
timerCount | int | state | 1 | 0 | Unrestricted | Â |
currentGain | float | state | 1 | 1 | Unrestricted | Â |
targetGain | float | state | 1 | 1 | Unrestricted | Â |
smoothingCoeff | float | state | 1 | 1 | Unrestricted | Â |
Pins
Input Pins
Name: trigger
Description: trigger signal
Data type: int
Channel range: 1
Block size range: 1
Sample rate range: Unrestricted
Complex support: Real
Â
Name: in
Description: audio input
Data type: float
Channel range: Unrestricted
Block size range: Unrestricted
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: out
Description: audio output
Data type: float
MATLAB Usage
File Name: ducker_module.m
M=ducker_module(NAME)
Audio Weaver module to reduce the audio level of the input signal based on the
trigger input. The module has two input pins and one output pin.
The first input pin is the trigger input of single channel and blockSize=1,
contains a boolean value. The second input pin is the audio input contains
N channels and arbitary blockSize. The output pin contains same number of
channels and blockSize as the input audio signal.
Arguments:
NAME - name of the module.
Â