Skip to content

ActivationMux

Discussion

This is a subsystem which implements an intelligent multiplexor that safely activates and deactivates modules or subsystems connected to it.

In the module arguments, the user specifies the number of inputs (numMod), the names of subsystems/modules to control, and whether the module has a control input pin (indexPin) and/or a state output pin (transitionPin). The state output pin will output 0 when the module is in steady state, and 1 when the module is transitioning from one active subsystem/module to another. The subsystems/modules being controlled by this module must be listed in the same order that they are connected to the input pins; that is, the subsystem/module listed for the ModOrSubSys1 arg must be connected to input pin in1. Each subsystem/module connected must be at the same hierarchy level as the ActivationMux

The module has a zero-based index variable that controls which input signal path is active (index = 0 selects pin in1 as active). The optional indexPin can be used to control the index instead of accessing the variable directly. When the index changes, the module goes through these steps to transition from the previously active system to the new system:

  1. Mute the output

  2. Set the previously active subsystem/module to INACTIVE or BYPASS

  3. Set the newly active subsystem/module to ACTIVE

  4. Unmute the output

These steps allow for more deterministic control when activating and deactivating subsystems because it doesn't matter how long it takes for the state changing to happen. If used correctly, this module will eliminate potential causes of audio glitches and CPU overflows while transitioning the states of multiple subsystems/modules.

Note: Use BYPASS instead of INACTIVE in the case of having FIFO style modules included (e.g. BufferUp/BufferDown), where the input and output buffers must remained synced.

Module Pack

Advanced

ClassID

classID =

Type Definition

typedef struct _ModuleActivationMux
{
ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
} ModuleActivationMuxClass;

Variables

Properties

Name Type Usage isHidden Default Value Range Units
index int state 0 0 0:9
muteTime int parameter 0 100 0:1000 msec
setBehavior int parameter 0 0 0:3
indexPin int const 1 1 Unrestricted

Pins

Input Pins

Name idx
Description input pin control signal
Data type int
Channel range 1:1:1
Block size range 1:1:1
Sample rate range Unrestricted
Complex support Real
Name in1
Description in
Data type float
Channel range Unrestricted
Block size range Unrestricted
Sample rate range Unrestricted
Complex support Real and Complex
Name in2
Description in
Data type float
Channel range Unrestricted
Block size range Unrestricted
Sample rate range Unrestricted
Complex support Real and Complex
Name in3
Description in
Data type float
Channel range Unrestricted
Block size range Unrestricted
Sample rate range Unrestricted
Complex support Real and Complex
Name in4
Description in
Data type float
Channel range Unrestricted
Block size range Unrestricted
Sample rate range Unrestricted
Complex support Real and Complex
Name in5
Description in
Data type float
Channel range Unrestricted
Block size range Unrestricted
Sample rate range Unrestricted
Complex support Real and Complex
Name in6
Description in
Data type float
Channel range Unrestricted
Block size range Unrestricted
Sample rate range Unrestricted
Complex support Real and Complex
Name in7
Description in
Data type float
Channel range Unrestricted
Block size range Unrestricted
Sample rate range Unrestricted
Complex support Real and Complex
Name in8
Description in
Data type float
Channel range Unrestricted
Block size range Unrestricted
Sample rate range Unrestricted
Complex support Real and Complex
Name in9
Description in
Data type float
Channel range Unrestricted
Block size range Unrestricted
Sample rate range Unrestricted
Complex support Real and Complex
Name in10
Description in
Data type float
Channel range Unrestricted
Block size range Unrestricted
Sample rate range Unrestricted
Complex support Real and Complex

Output Pins

Name stateCtrl
Description transition state output signal
Data Type int
Name out
Description output signal
Data Type float

Scratch Pins

Channel Count 1
Block size 32
Sample rate 48000
Channel Count 1
Block size 32
Sample rate 48000
Channel Count 1
Block size 1
Sample rate 48000

Matlab Usage

File Name: activation_multiplexor_subsystem.m 
 SYS = activation_multiplexor_subsystem(NAME, NUMMOD, OFFSTATE, INDEXPIN, TRANSITIONPIN, MOD_1, ...) 

 Creates an intelligent multiplexor which activates and deactivates  
 modules connected to it. 

 Arguments: 
    NAME - name of the module. 
    NUMMOD - specifies the number of modules/subsystems to be controlled 
    OFFSTATE - select state for inactive (0 - INACTIVE, 
    1 - BYPASS) 
    INDEXPIN - enables or disables the control pin 
    TRANSITIONPIN - boolean control output signal that tells when the state  
                    transition is occurring 
    MOD_N - specifies the module to be controlled. If a subsystem is 
            specified, then this module will recursively act on all modules and 
            subsystem within that subsystem. The name specified is relative to the 
            level of the status_set_module. 
            The specified MOD name can either be an absolute or relative path from 
            the status_set_module. The backslash character ''\'' before a module 
            is used to denote a module one level up in hierachy. Multiple backslashes 
            can be used to represent multiple levels of hierarchy. 

Copyright (c) 2026 DSP Concepts, Inc.