...
Code Block |
---|
typedef struct _ModuleMultiplexorV2ModuleMultiplexorV2Fract32 { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure INT32 index; // Specifies which input pin to route to the output. The index is zero based. FLOAT32 smoothingTime; // Time constant of the smoothing process FLOAT32 fadeTime; // Silence time in crossfade INT32 isControl; // Indicates if the index is controlled by an external signal FLOAT32fract32 smoothingCoeffsmoothingCoeffFract32; // Smoothing coefficient FLOAT32fract32 oldSrcGain; oldSrcGainFract32; // Instanteous gain being applied to the old source. This is an internal variable used in the smoothing process FLOAT32fract32 newSrcGain; newSrcGainFract32; // Instanteous gain being applied to the new source. This is an internal variable used in the smoothing process INT32 fadeState; // State variable for determining when to transitioning between inputs INT32 fadeStateInit; // Derived from fadeTime, determines number of blocks to wait before switching input pins INT32 oldIndex; // This is the index that is currently being used and the module smoothly transitions to index INT32 newIndex; // This is index that is currently being used and the indexmodule beingsmoothly transitionedtransitions to index } ModuleMultiplexorV2ClassModuleMultiplexorV2Fract32Class; |
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
index | int | parameter | 0 | 0 | 0:2 | |
smoothingTime | float | parameter | 0 | 10 | 0:100 | msec |
fadeTime | float | parameter | 00 | 10 | 0:100 | msec |
isControl | int | const | 1 | 1 | Unrestricted | |
smoothingCoeffsmoothingCoeffFract32 | floatfract32 | derived | 1 | 0.002081 | Unrestricted | |
oldSrcGainoldSrcGainFract32 | floatfract32 | state | 11 | 0 | Unrestricted | |
newSrcGainnewSrcGainFract32 | floatfract32 | state | 1 | 0 | Unrestricted | |
fadeState | int | state | 1 | 0 | Unrestricted | |
fadeStateInit | int | derived | 1 | 0983100 | Unrestricted | |
oldIndex | int | parameter | 1 | 0 | Unrestricted | |
newIndex | int | parameter | 1 | 0 | Unrestricted |
...
Description: Input signal
Data type: floatfract32
Channel range: Unrestricted
...
Sample rate range: Unrestricted
Complex support: Real and Complex
Name: in2
Description: Input signal
Data type: floatfract32
Channel range: Unrestricted
...
Sample rate range: Unrestricted
Complex support: Real and Complex
Name: in3
Description: Input signal
Data type: floatfract32
Channel range: Unrestricted
...
Sample rate range: Unrestricted
Complex support: Real and Complex
Output Pins
Name: out
Description: Output signal
Data type: floatfract32
MATLAB Usage
File Name: multiplexor_v2_fract32_module.m
Code Block |
---|
M = multiplexor_v2_fract32_module(NAME, ISCONTROL, NUMINPINS)
Creates a multiplexor module that seamlessly switches between inputs.
The module has multiple input pins and switches from one input to another.
The optional control pin is the first pin (when enabled) and determines
which of N inputs is selected. The input pin is an integer value in the
range 0 to N-1.
Arguments:
NAME - name of the module.
ISCONTROL - enables or disables the control pin
NUMINPINS - number of input pins.
All input pins must have the same block size and number of channels.
Note, this verson implements an optional smooth crossfade between inputs. |
...