Document toolboxDocument toolbox

(8.D.2.7) DelayMsec

Overview

Time delay in which the delay is specified in milliseconds

Discussion

A delay module, where the delay is specified in milliseconds. The module has one multichannel input and one multichannel output. The module can operate on multiple channels and applies the same delay to each channel.

At construction time, specify the maximum delay time (maxDelayTime) of the module. The variable, maxDelayTime determines the size of the internal state buffer. The size of the internal state buffer equals (maxDelay+1)*numChannels. In addition, the instantaneous delay is specified through the interface variable, currentDelay. currentDelay is in the range of [0 maxDelayTime] and can be changed at run-time.

delay = floor( currentDelay * SR ) / SR

Note that the module is not smoothly updating and you may get audible clicks when adjusting the currentDelay at run-time.

Type Definition

typedef struct _ModuleDelayMsec { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure FLOAT32 maxDelayTime; // Maximum delay, in milliseconds. FLOAT32 currentDelayTime; // Current delay. INT32 stateHeap; // Heap in which to allocate state buffer memory. awe_modDelayInstance *delay; // Time delay in which the delay is specified in samples } ModuleDelayMsecClass;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

maxDelayTime

float

const

0

10

0:10

msec

currentDelayTime

float

parameter

0

0

0:10

msec

stateHeap

int

const

1

561

Unrestricted

 

Pins

Input Pins

Name: in

Description: Audio Input

Data type: {float, int, fract32}

Channel range: Unrestricted

Block size range: Unrestricted

Sample rate range: Unrestricted

Complex support: Real

Output Pins

Name: out

Description: Audio output

Data type: {float, int, fract32}

MATLAB Usage

File Name: delaymsec_module.m

SYS=delaymsec_module(NAME, MAXDELAY, MEMHEAP) Creates a delay module in which the delay times are specified in milliseconds. Arguments: NAME - name of the module. MAXDELAY - maximum delay of the module, in milliseconds. 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. Internally, this uses a the sample-based delay and builds an inteface on top of it.

Â