Array Get
This module is a variant of the ParamGet module which is able to read array variables from a module.
The name of the module and the name of the internal variable are specified as module arguments. The module reads the array in the real-time thread and you can optionally call the module's Get function.
The array variable is specified as modName.variableName.
If the variable being read is not an array, then you will get an error when you build the system. If you need to read a scalar variable then use ParamGet module.
The read behavior of the module is specified on the inspector in the 'Get Behavior' droplist. The array variable is read on every pump.
AlwaysNoGet - the variable values are read and the module's Get function is not called.
AlwaysDeferredSet - the variable values are read and the module's Get function is called from the deferred thread. The updates from the Get function will be available in a later pump of the module.
AlwaysInstanceGet - the module's Get function is called from the real-time thread and then the values are read. This can lead to an increase in the CPU load.
The most useful setting is AlwaysDeferredGet.
The 'numValues' argument specifies the number of values to read and this will size the output wire. If numValues is empty, then the number of values is taken from the modVar variable total number of values.
The 'numChannels' argument specifies the number channels for the output wire. If numChannels is empty, then the number of channels is taken from the modVar variable number of cols.
The 'blockSize' argument specifies the block size for the output wire. If blockSize is empty, then the block sizeis taken from the modVar variable number of rows.
The 'sampleRate' argument specifies the sample rate for the output wire. If sampleRate is empty, then the wire sample rate is set to the block rate of this ArrayGet module.
You do not have to read the entire array; you can only read a portion of the array. The 'startIndex' variable specifies where to start reading in the array. This is a zero-based offset. The 'step' variable is added to the array index after every read occurs.
For example, if step=1, then values are read sequentially from the array. If you set step=2, then every second value in the array is read.
Note that step only applies to the read index; the write index used when writing the wire buffer is always 1.
You can even set startIndex to a negative number and reads will not occur until you are within the actual bounds of the array.
There is logic in the module to prevent you from reading outside of the array bounds. If you do read outside of the array bounds, then the 'Out of Range Index' LED will be lit on the inspector and the values that fall within valid array indices are read.
Module Pack
Advanced
ClassID
classID = 1457
Type Definition
typedef struct _ModuleArrayGet
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
INT32 getBehavior; // Controls the behavior of the module
INT32 startIndex; // Location to start reading from in the array
INT32 step; // Increment between reading of values
INT32 outOfRangeIndex; // Boolean that indicates when the module is reading outside of the array size
INT32 arrayLength; // Total length of the array variable
UINT32 mask; // Mask used when calling the get function
void * modPtr; // Points to the module to get
void * varPtr; // Points to the variable to get within the module instance structure
} ModuleArrayGetClass;
Variables
Properties
| Name | Type | Usage | isHidden | Default Value | Range | Units |
|---|---|---|---|---|---|---|
| getBehavior | int | parameter | 0 | 1 | Unrestricted | |
| startIndex | int | parameter | 0 | 0 | Unrestricted | |
| step | int | parameter | 0 | 1 | Unrestricted | |
| outOfRangeIndex | int | state | 0 | 0 | Unrestricted | |
| arrayLength | int | parameter | 1 | 0 | Unrestricted | |
| mask | uint | derived | 1 | 0 | Unrestricted | |
| modPtr | void * | parameter | 1 | Unrestricted | ||
| varPtr | void * | parameter | 1 | Unrestricted |
Pins
Output Pins
| Name | value |
| Description | parameter value |
| Data Type | {float, int, fract32} |
Matlab Usage
File Name: array_get_module.m
M = array_get_module(NAME, SUBCANVAS_NAME, MODVAR, NUM_VALUES, NUM_CHANNELS, BLOCK_SIZE, SAMPLE_RATE, EXECUTION_ORDER)
Module which reads array values from the Subcanvas module. Arguments:
NAME - Name of the module.
MODVAR - 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'. The variable being read from must be an array.
NUM_VALUES - Number of values to read from the array. If you leave this empty,
then the module will read out all values of the array.
NUM_CHANNELS - Number of channels configured for the output pin.
BLOCK_SIZE - Block size configured for the output pin.
SAMPLE_RATE - Sample rate of the output pin, in Hz. If this is empty, then
the sample rate is the block rate of the first input pin at this
level of hierarchy.
EXECUTION_ORDER - Determines when the ParamGet 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 ParamGet to execute before the module it
is controlling.
'after' - forces ParamGet 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.
The module output pin will default to 1 channel with a blockSize of NUM_VALUES
if the NUM_CHANNELS and BLOCK_SIZE arguments are left empty.
If NUM_VALUES, NUM_CHANNELS and BLOCK_SIZE are left empty then the
output pin number of channels shall be the modVar variable rows and the output
pin block size shall be the modVar variable cols if those arguments are left empty.
Copyright (c) 2026 DSP Concepts, Inc.