(8.D.2.3) Arrayset
Overview
Sets the array elements in the Target module Filters with data from input wire
Discussion
The Array Set module reads the data coming in from the input wire and reaches into instance structure of the target module to copy the data to the target array. The Array data structure of the target module is pointed to by the argument " MOD.VAR". See the Param Set module for more details on how to specify the target module and array.
An optional control pin is also supported that enables copying the input data to the MOD.VAR array when the first value of the control pin data !=0. If the control pin is not used, then the data is written to the target array on every execution.
The Array Set module also supports 3 different options to set the values at the target (NoSet, DeferredSet, InstantSet).
NoSet: Updates target module array - never calls the target module's set function
DeferredSet: Updates target module array - uses a deferred call to the target module's set function so it executes after processing is complete
InstantSet: Updates target module array - immediately calls the target module's set function during the Array Set process
The argument executionOrder determines when the array set will actually execute in relation to the module it is controlling:
Undefined = Let the build process decide
Before = Set the parameter before the target module executes
After = Set the parameter after the target module executes
This can be confirmed by generating a .AWS file and looking at the order which the modules are added to the layout, which set the execution order.
Type Definition
typedef struct _ModuleArrayset
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
INT32 setBehavior; // Controls the behavior of the module
void * modPtr; // Points to the module to set
void * varPtr; // Points to the variable to set within the module instance structure
} ModuleArraysetClass;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
setBehavior | int | parameter | 0 | 2 | Unrestricted | Â |
modPtr | void * | parameter | 1 | Â | Unrestricted | Â |
varPtr | void * | parameter | 1 | Â | Unrestricted | Â |
Pins
Input Pins
Name: control
Description: Input control signal
Data type: {float, int, fract32}
Channel range: Unrestricted
Block size range: Unrestricted
Sample rate range: Unrestricted
Complex support: Real and Complex
Â
Name: in
Description: Input data
Data type: {float, int, fract32}
Channel range: Unrestricted
Block size range: Unrestricted
Sample rate range: Unrestricted
Complex support: Real and Complex
MATLAB Usage
File Name: arrayset_module.m
M = arrayset_module(NAME, MODVAR, CONTROLPIN)
Array set module. This module can reach into the instance structure
of other modules and set array data structures.
This module reads the data coming in from the input wire and reaches into instance structure of the
target module to copy the data. The Array data structure of the target module is pointed to by the argument "MOD.VAR".
An optional control pin is also supported that controls the setting of the MOD.VAR array when the value control pin data doesn't equal 0.
If the control pin is not used, then the data is written to the target array on every execution.
The Array Set module also supports 3 different options to set the values at the target (NoSet, DeferredSet, InstantSet).
Arguments:
NAME - Name of the module.
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'.
CONTROLPIN - Boolean to add control input pin or not
EXECUTIONORDER - Determines when the ParamSet module executes relative
to the module it is controlling. Allowable values are:
'undefined' - the default. The execution order is set
by the routing algorithm and can occur before
or after the module it is controlling.
'before' - forces ParamSet to execute before the module it
is controlling.
'after' - forces ParamSet to execute after the module it
is controlling.
When using 'before' and 'after' you could get a build error
indicating that no more modules can execute or there is a
circular dependency.
Â