Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Scroll Documents: Update page title prefix

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

Code Block
typedef struct _ModuleDuckerFract32
{
    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.
    fract32 duckLevelLinear;                      // Level in dB at which the input will be attenuated when ducking is active.
    fract32 attackCoeff;                          // Internal coefficient realizing the attack time.
    fract32 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.
    fract32 currentGain;                          // Instantaneous gain applied by the module.
    fract32 targetGain;                           // Target gain applied by the module.
    fract32 smoothingCoeff;                       // Internal coefficient realizing the smoothing time.
} ModuleDuckerFract32Class;

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

fract32

derived

1

0.1

Unrestricted

attackCoeff

fract32

derived

1

0.001041

Unrestricted

releaseCoeff

fract32

derived

1

0.0002083

Unrestricted

timerPeriod

int

derived

1

1590

Unrestricted

timerCount

int

state

1

0

Unrestricted

currentGain

fract32

state

1

1

Unrestricted

targetGain

fract32

state

1

1

Unrestricted

smoothingCoeff

fract32

state

1

1

Unrestricted

Pins

Input Pins

Name: trigger

Description: trigger signal

...

Sample rate range: Unrestricted

Complex support: Real

Output Pins

Name: out

Description: audio output

Data type: fract32

MATLAB Usage

File Name: ducker_fract32_module.m

...