SampleAndHoldInt32
Discussion
An audio rate sample and hold module for use with the Audio Engine. The module has two input pins: trigger and data. The module samples the input data whenever trigger != 0. The module is designed to work with multichannel data. There are two operating modes. If the trigger pin has a single channel, then the trigger is applied to all of the interleaved data channels. Otherwise, if the trigger has the same number of channels as the data, then a separate trigger is applied to each channel.
Internally, the module stores the sampled data within the value array. This array has 1 sample per input channel.
Module Pack
Advanced
ClassID
classID = 1315
Type Definition
typedef struct _ModuleSampleAndHoldInt32
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
INT32* value; // Holds the last data value which was sampled. This is an array so that multiple channels can be supported.
} ModuleSampleAndHoldInt32Class;
Variables
Properties
| Name | Type | Usage | isHidden | Default Value | Range | Units |
|---|---|---|---|---|---|---|
| value | int* | state | 0 | [1 x 1] | -2147483648:2147483647 |
Pins
Input Pins
| Name | trig |
| Description | trigger signal |
| Data type | int |
| Channel range | Unrestricted |
| Block size range | Unrestricted |
| Sample rate range | Unrestricted |
| Complex support | Real |
| Name | in |
| Description | input data |
| Data type | int |
| Channel range | Unrestricted |
| Block size range | Unrestricted |
| Sample rate range | Unrestricted |
| Complex support | Real |
Output Pins
| Name | out |
| Description | output data |
| Data Type | int |
Matlab Usage
File Name: sample_and_hold_int_module.m
M=sample_and_hold_int_module(NAME)
Creates a sample and hold module with Integer support for use with the Audio Weaver.
NAME - name of the module.
Copyright (c) 2026 DSP Concepts, Inc.