Skip to main content
Skip table of contents

MuteUnmuteFract32

Overview

Multichannel smooth mute

Discussion

This module is used to hide pops and clicks during transitions. The module smoothly mutes, outputs silence, and then smoothly unmutes. You have full control over mute period, silence period, and unmuting period.

The .trigger variable is used to engage the entire process. Normally trigger=0 and the module passes the input unchanged. When you set trigger=1, then the module goes through the overall mute/silence/unmute cycle.

The module uses a raised cosine window for muting and unmuting. For memory efficiency the module uses a complex recursion to compute the gain profile for the raised cosine.

The constructor argument INITIALSTATE allows you to set the initial state of the trigger variable. By default, INITIALSTATE = 0 meaning that the module starts up unmuted. If you set INITIALSTATE = 1, then the module starts out muted.

Type Definition

CODE
typedef struct _ModuleMuteUnmuteFract32
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    INT32 trigger;                                // Begins the muting and unmuting process
    FLOAT32 muteTime;                             // Muting time, in msec
    FLOAT32 silenceTime;                          // Duration of the silence period, in msec
    FLOAT32 unmuteTime;                           // Unmuting time, in msec
    INT32 muteTimeSamples;                        // Muting time, in samples
    INT32 silenceTimeSamples;                     // Silence time, in samples
    INT32 unmuteTimeSamples;                      // Unmuting time, in samples
    fract32 muteCoeffR;                           // One of two coefficients used to compute the muting profile
    fract32 muteCoeffI;                           // One of two coefficients used to compute the muting profile
    fract32 unmuteCoeffR;                         // One of two coefficients used to compute the unmuting profile
    fract32 unmuteCoeffI;                         // One of two coefficients used to compute the unmuting profile
    fract32 stateR;                               // One of two state variables which control the ramping profile
    fract32 stateI;                               // One of two state variables which control the ramping profile
    INT32 sampleTime;                             // Counts the samples elapsed in the entire mute/silence/unmute cycle
} ModuleMuteUnmuteFract32Class;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

trigger

int

state

0

0

0:1

muteTime

float

parameter

0

5

1:1000

silenceTime

float

parameter

0

100

0:10000

unmuteTime

float

parameter

0

50

1:1000

muteTimeSamples

int

derived

1

240

Unrestricted

silenceTimeSamples

int

derived

1

4800

Unrestricted

unmuteTimeSamples

int

derived

1

2400

Unrestricted

muteCoeffR

fract32

derived

1

0.9999

Unrestricted

muteCoeffI

fract32

derived

1

0.01309

Unrestricted

unmuteCoeffR

fract32

derived

1

1

Unrestricted

unmuteCoeffI

fract32

derived

1

0.001309

Unrestricted

stateR

fract32

state

1

0

Unrestricted

stateI

fract32

state

1

0

Unrestricted

sampleTime

int

state

1

0

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

Scratch Pins

Channel count: 1

Block size: 32

Sample rate: 48000

MATLAB Usage

File Name: mute_unmute_fract32_module.m

CODE
 M=mute_unmute_fract32_module(NAME, INITIALSTATE)
 Creates a smoothly varying scalersmoothed object for use in the
 Audio Weaver.  Arguments:
    NAME - name of the module.
    INITIALSTATE - optional argument which specifies the default state
      of the trigger variable.  By default, INITIALSTATE = 0 meaning that
      the module comes up unmuted.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.