Skip to content

MuteNSymmetric

Discussion

Smoothly mutes/unmutes all input channels. The array .isMuted has a separate value for each channel in the signal. The size of .isMuted is set by the prebuild function based on the number of input channels

This module approaches its target gain exponentially and sample exact based on the timeToMute parameter, hence the name: symmetric.

The isMuted value for the channel parameter together with muteThreshold is automatically converted to a value for the internal targetGain variable.

Current gain can be updated per sample (blockOrSample = 0) or per block (blockOrSample = 1). In Per Block mode the module processing load is reduced as the current gain smoothing is performed in steps (once per block), whereas in per sample mode continous smoothing is performed.

Fully muted channels will output zeros. Fully unmuted channels simply copy the input samples to the output. All other channels scale the input by current gain till the target gain is reached.

If timeToMute = 0 then no smoothing is being performed.

Module Pack

Advanced

ClassID

classID = 1445

Type Definition

typedef struct _ModuleMuteNSymmetric
{
ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
INT32 timeToMute;                             // Time to fully mute/unmute in msec.
INT32 blockOrSample;                          // Gain computed per block [checked] or per sample [unchecked]
FLOAT32 muteThreshold;                        // Level (lin) considered to be fully muted
FLOAT32 muteThreshold_dB;                     // Level (dB) considered to be fully muted
INT32* isMuted;                               // Boolean that controls muting/unmuting.  One per channel.
FLOAT32* targetGain;                          // Computed target gains in linear units
FLOAT32* gradient;                            // Precalculated delta or gradient
FLOAT32* currentGain;                         // Instantaneous gain applied by the module. This is also the starting gain of the module.
INT32* sampleCounter;                         // Sample Counter for each channels Mute/Unmute Ramp
} ModuleMuteNSymmetricClass;

Variables

Properties

Name Type Usage isHidden Default Value Range Units
timeToMute int parameter 0 10 0:1000 msec
blockOrSample int const 0 0 Unrestricted
muteThreshold float derived 1 1e-07 Unrestricted
muteThreshold_dB float const 1 -140 Unrestricted
isMuted int* parameter 0 [1 x 1] 0:1
targetGain float* derived 1 [1 x 1] 0:1 linear
gradient float* derived 1 [1 x 1] 0:1 linear
currentGain float* state 1 [1 x 1] 0:1 linear
sampleCounter int* state 1 [1 x 1] Unrestricted linear

Pins

Input Pins

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: muten_symmetric_module.m 
 M = muten_symmetric_module(NAME, MUTETHRESHOLD, BLOCKORSAMPLE, TRANSPOSE) 
 Creates a module with independent Mute Control for each input channel, which smoothly mutes and unmutes using symmetric ramps, 
 meaning it takes equal time for fadeIn and fadeOut. 

 Arguments: 
    NAME - name of the module. 
    MUTETHRESHOLD - level in dB considered to be fully muted (default = -140dB) 
    BLOCKORSAMPLE - gain computed per block or per sample (default = 0/false or per sample) 
    TRANSPOSE - an optional argument which controls how the inspector 
       for the module is drawn.  By default, if there are N channels 
       then the inspector control is a vertical stack of N checkboxes. 
       (TRANSPOSE = 0 by default).  If TRANSPOSE = 1, then the inspector 
       is drawn as a horizontal array of N checkboxes. 

Copyright (c) 2026 DSP Concepts, Inc.