(8.D.2.5) DelayNTap16Fract32
Overview
Time delay with multiple output taps
Discussion
Time delay with multiple output taps. The module has a mono input and multiple output "taps". The module can be configured to have multiple output pins (ONEOUTPUTPIN = 0, the default), or a single multichannel output pin(ONEOUTPUTPIN = 1). Each tap has its own delay time and its own output pin (or channel). The delay of each output channel can be independently set by the currentDelay array. The number of output channels (NUMTAPS) is specified at construction time and this also equals the length of the currentDelay array. Delays are specified in samples and are in the range of [0 MAXDELAY].
At construction time, you specify the maximum delay (maxDelay) of the module. The variable, maxDelay determines the size of the internal state buffer. This module saves memory by using a 16-bit array of samples. The input and output pins are fract32 and only the high 16-bits of the input audio data is stored in the state array. The output pins have fract32 data but only the high 16-bits have audio data; the bottom 16-bits are all zeros. The size of the internal state buffer equals (maxDelay+blockSize+1)/2 32-bit samples. The 16-bit audio samples are packed two per 32-bit word. The delay time per channel is specified by the currentDelay array. Delays can be adjusted at run-time. However, the module is not smoothly updating and you may get audible clicks when adjusting the currentDelay at run-time.
Type Definition
typedef struct _ModuleDelayNTap16Fract32
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
INT32 numTaps; // Number of output taps
INT32 maxDelay; // Maximum delay, in samples.
INT32 oneOutputPin; // Specifies a single multichannel output pin.
INT32 stateIndex; // Index of the oldest state variable in the array of state variables.
INT32 stateHeap; // Heap in which to allocate memory.
INT32* currentDelay; // Current delay.
INT32* state; // State variable array.
} ModuleDelayNTap16Fract32Class;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
numTaps | int | const | 0 | 5 | Unrestricted | Â |
maxDelay | int | const | 0 | 100 | 1:100000 | samples |
oneOutputPin | int | const | 0 | 0 | Unrestricted | Â |
stateIndex | int | state | 1 | 0 | Unrestricted | Â |
stateHeap | int | const | 1 | 561 | Unrestricted | Â |
currentDelay | int* | parameter | 0 | [5 x 1] | 0:1:100 | samples |
state | int* | state | 1 | [66 x 1] | Unrestricted | Â |
Pins
Input Pins
Name: in
Description: audio input
Data type: fract32
Channel range: 1
Block size range: Unrestricted
Sample rate range: Unrestricted
Complex support: Real
Output Pins
 Name: out1
Description: Audio output
Data type: fract32
Â
Name: out2
Description: Audio output
Data type: fract32
Â
Name: out3
Description: Audio output
Data type: fract32
Â
Name: out4
Description: Audio output
Data type: fract32
Â
Name: out5
Description: Audio output
Data type: fract32
MATLAB Usage
File Name: delayntap16_fract32_module.m
M=delayntap16_fract32_module(NAME, NUMTAPS, MAXDELAY, MEMHEAP, ONEOUTPUTPIN)
Creates a multi-tap time delay. The module has a single mono input pin
and either NUMTAPS mono output pins or a single output pin with NUMTAPS
channels. Each output channel is a delayed version of the input with
different delay times per channel. The input and output data is fract32
while the delay lines are stored using fract16. Only the upper 16-bits
of the input data are used. The output data is fract32 but only the upper
16-bits contain actual data; the lower 16-bits are all zeros. Arguments:
NAME - name of the module.
NUMTAPS - number of taps.
MAXDELAY - maximum delay, in samples.
MEMHEAP - specifies the memory heap to use to allocate the main
state buffer. This is a string and follows the memory allocation
enumeration in Framework.h. Allowable values are:
'AWE_HEAP_FAST' - always use internal DM memory.
'AWE_HEAP_FASTB' - always use internal PM memory.
'AWE_HEAP_SLOW' - always use external memory.
'AWE_HEAP_FAST2SLOW' - use internal memory. If this fails
then use external memory (the default).
'AWE_HEAP_FASTB2SLOW' - use internal memory. If this fails
then use external memory.
ONEOUTPUTPIN - Boolean which specifies whether the module has a NUMTAPS mono output
pins (ONEOUTPUTPIN = 0, the default) or one multichannel output pin
(ONEOUTPUTPIN = 1).
Â