Summary

Delay a signal, using external memory for longer delay times! Up to 8 separate delay taps can be used.


1 kHz burst, delayed 5.2 ms.

Audio Connections

PortPurpose
In 0Signal Input
Out 0Delay Tap #1
Out 1Delay Tap #2
Out 2Delay Tap #3
Out 3Delay Tap #4
Out 4Delay Tap #5
Out 5Delay Tap #6
Out 6Delay Tap #7
Out 7Delay Tap #8

Functions

delay(channel, milliseconds);

Set output channel (0 to 7) to delay the signals by milliseconds. The maximum delay is approx 333 ms. The actual delay is rounded to the nearest sample. Each channel can be configured for any delay. There is no requirement to configure the "taps" in increasing delay order.

disable(channel);

Disable a channel. The output of this channel becomes silent. If this channel is the longest delay, memory usage is automatically reduced to accomodate only the remaining channels used.

Hardware

By default, or when AUDIO_MEMORY_23LC1024 is used (see below), a single 23LC1024 RAM chip is used, with these pins:
PinSignal
6CS
7MOSI
12MISO
14SCK

When AUDIO_MEMORY_MEMORYBOARD is used, up to six 23LC1024 chips are used.


Memoryboard 4

PinSignal
2CS0 (encoded)
3CS1 (encoded)
4CS2 (encoded)
7MOSI
12MISO
14SCK

If fewer than 6 chips are soldered, the optional parameter for maximum delay must be used. See below for details. Each chip provides 1485 ms of delay memory, so the total of all objects using AUDIO_MEMORY_MEMORYBOARD must not exceed the amount of memory physically present.

Examples

Demo Video (YouTube)

Forum Conversaton (with sample code)

Notes

External RAM allows for longer delays without consuming limited internal RAM. However, SPI communication is required, which consumes much more CPU time. The AudioProcessorUsageMax function may be used to monitor how much CPU time is consumed.

You may specify the type of hardware to be used by editing the code. AUDIO_MEMORY_23LC1024 specifies a single 23LC1024 chip. AUDIO_MEMORY_MEMORYBOARD allows using up to 6 of these chips.

AudioEffectDelayExternal delayExt1(AUDIO_MEMORY_23LC1024);

You may also create more than one delay using the same hardware, where the memory is partitioned by specifying a maximum delay in milliseconds. This can be useful if you wish to delay both channels of a stereo signal.

AudioEffectDelayExternal delayExt1(AUDIO_MEMORY_23LC1024, 700);
AudioEffectDelayExternal delayExt2(AUDIO_MEMORY_23LC1024, 700);