PresetArrayHandler
Overview
Updates module array from different preset tables.
Discussion
This module updates the array of any other module from the presetsArray. The presetsArray is a 3-D array of numArrays, each with size numRows x numCols. The 3-D array is arranged as cascaded 2-D arrays For example, 3 arrays with size 2 x 3 each is arranged as 0 0 0 0 0 0 1 1 1 1 1 1 2 2 2 2 2 2 where 2x3 array with zeros is one array, 2x3 array with ones is second array and so on. The cascaded 2-D array is multiplied or added element by element to create one 2-D array of size numRows x numCols, which is then used to update the array of the other module. The math operation is controlled by the operation argument, either multiplication or addition.
Type Definition
typedef struct _ModulePresetArrayHandler
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
INT32 numArrays; // number of presets.
INT32 numRows; // the number of vectors.
INT32 numCols; // the size of each vector.
INT32 operation; // math operation on presets. 0 - multiplication and 1 - addition.
INT32 initialFlag; // boolean flag which handles initial setup.
FLOAT32* presetsArray; // 3-D presets array table.
void * modPtr; // Points to the module to set.
void * varPtr; // Points to the variable to set within the module instance structure.
} ModulePresetArrayHandlerClass;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
numArrays | int | const | 0 | 2 | Unrestricted | |
numRows | int | const | 0 | 1 | Unrestricted | |
numCols | int | const | 0 | 5 | Unrestricted | |
operation | int | const | 0 | 0 | Unrestricted | |
initialFlag | int | state | 0 | 1 | Unrestricted | |
presetsArray | float* | parameter | 0 | [2 x 5] | Unrestricted | |
modPtr | void * | parameter | 1 | Unrestricted | ||
varPtr | void * | parameter | 1 | Unrestricted |
MATLAB Usage
File Name: preset_array_handler_module.m
M=preset_array_handler_module(NAME, NUMARRAYS, NUMROWS, NUMCOLS, OPERATION, MODVAR)
Array set module. This module can reach into the instance structure
of other modules and set filter coefficients.
Arguments:
NAME - name of the module.
NUMARRAYS - number of presets, the Z dimension of internal table.
NUMROWS - the dimension X of internal table.
NUMCOLS - the dimension Y of internal table.
OPERATION - operation to be performed on presets (multiply or addition).
0 - Multiplication
1 - Addition
VARNAME - specifies the module and variable name using the form:
'MOD.VAR' where MOD is the module name and VAR is the
variable name. You can also specify internal subsystems using
'SUBSYS.MOD.VAR'.