(8.D.2.3) MuteSmoothedFract32
Overview
Multichannel smooth mute
Discussion
Smoothly mutes all input channels. Muting/unmuting is controlled by the isMuted parameter The isMuted parameter is automatically converted to a value for the internal gain variable. isMuted = 1 --> gain = 0. isMuted = 0 --> gain = 1. gain serves as a target gain for the module. Changes to the gain variable are exponentially smoothed (first order IIR) at the sample rate, with the time constant determined by the smoothingTime parameter. The internal variable currentGain represents the instantaneous smoothed gain that is applied to the data stream. currentGain exponentially approaches gain with a time constant equal to smoothingTime.
currentGain also serves as the starting gain of the module. If currentGain = gain, then the module starts up in a converged state. If currentGain != gain, then the module will smoothly vary the gain at startup.
Type Definition
typedef struct _ModuleMuteSmoothedFract32
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
INT32 isMuted; // Target gain factor decider
FLOAT32 smoothingTime; // Time constant of the smoothing process
fract32 currentGain; // Instantaneous gain applied by the module. This is also the starting gain of the module.
fract32 smoothingCoeffFract32; // Smoothing coefficient
fract32 target_gainFract32; // Target gain
} ModuleMuteSmoothedFract32Class;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
isMuted | int | parameter | 0 | 0 | 0:1 | Â |
smoothingTime | float | parameter | 0 | 10 | 0:1000 | msec |
currentGain | fract32 | state | 1 | 0 | 0:0.9999 | linear |
smoothingCoeffFract32 | fract32 | derived | 1 | 0.002081 | Unrestricted | Â |
target_gainFract32 | fract32 | derived | 1 | 0.9999 | Unrestricted | Â |
Pins
Input Pins
Name: in
Description: audio input
Data type: fract32
Channel range: Unrestricted
Block size range: Unrestricted
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: out
Description: audio output
Data type: fract32
MATLAB Usage
File Name: mute_smoothed_fract32_module.m
M=mute_smoothed_fract32_module(NAME)
Creates a smoothly varying scalersmoothed object for use in the
Audio Weaver. Arguments:
NAME - name of the module.
Â