Versions Compared

Key

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

Overview

Fixed-point smoothed mute with synchronous requests

Discussion

Smoothly change the gain of all input channels to 0 (mute) or 1 (unmute). You have full control over the time that it takes to mute and unmute. Gain values applied are available on an optional second output pin.

...

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

Type Definition

Code Block
typedef struct _ModuleMuteSyncFract32
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    INT32 isMuted;                                // Boolean for target gain: 1 means silence
    INT32 asyncCommand;                           // Start changing the gain without waiting for completion: 1=unmute, 2=mute
    INT32 syncCommand;                            // Change the gain and return only when finished: 1=unmute, 2=mute
    FLOAT32 muteTime;                             // Muting time in msec
    FLOAT32 unmuteTime;                           // Unmuting time in msec
    INT32 compatSync;                             // When true, isMuted compatibility is synchronous
    INT32 muteState;                              // Current muting action: 0=not set, 1=unmuted, 2=muted, 3=unmute changing, 4=mute changing
    fract32 currentGain;                          // Gain being applied to start of next sample block
    fract32 muteRotateI;                          // Imaginary part of multiplier to rotate phasor while muting
    INT32 syncState;                              // Active synchronous target state
    INT32 muteSamples;                            // Muting time in samples
    INT32 unmuteSamples;                          // Unmuting time in samples
    fract32 muteRotateR;                          // Real part of multiplier to rotate phasor while muting
    fract32 unmuteRotateR;                        // Real part of multiplier to rotate phasor while unmuting
    fract32 unmuteRotateI;                        // Imaginary part of multiplier to rotate phasor while unmuting
    fract32 phasorR;                              // Real part of complex phasor used to compute cosine
    fract32 phasorI;                              // Imaginary part of complex phasor used to compute cosine
    INT32 sampleTime;                             // Counts samples since the start of the active mute or unmute operation
} ModuleMuteSyncFract32Class;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

isMuted

int

state

0

0

0:1

asyncCommand

int

state

0

0

0:2

syncCommand

int

state

0

0

0:2

muteTime

float

parameter

0

5

1:1000

unmuteTime

float

parameter

0

50

1:1000

compatSync

int

state

0

1

Unrestricted

muteState

int

state

0

1

0:4

currentGain

fract32

derived

0

0

Unrestricted

muteRotateI

fract32

derived

0

0.01309

Unrestricted

syncState

int

derived

1

1

Unrestricted

muteSamples

int

derived

1

240

Unrestricted

unmuteSamples

int

derived

1

2400

Unrestricted

muteRotateR

fract32

derived

1

0.9999

Unrestricted

unmuteRotateR

fract32

derived

1

1

Unrestricted

unmuteRotateI

fract32

derived

1

0.001309

Unrestricted

phasorR

fract32

state

1

0

Unrestricted

phasorI

fract32

state

1

0

Unrestricted

sampleTime

int

state

1

0

Unrestricted

Pins

Input Pins

Name: in

Description: audio input

...

Sample rate range: Unrestricted

Complex support: Real

Output Pins

Name: out

Description: audio output

Data type: fract32

MATLAB Usage

File Name: mute_sync_fract32_module.m

...