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.
Port | Purpose |
---|---|
In 0 | Signal Input |
Out 0 | Delay Tap #1 |
Out 1 | Delay Tap #2 |
Out 2 | Delay Tap #3 |
Out 3 | Delay Tap #4 |
Out 4 | Delay Tap #5 |
Out 5 | Delay Tap #6 |
Out 6 | Delay Tap #7 |
Out 7 | Delay Tap #8 |
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.
By default, or when AUDIO_MEMORY_23LC1024 is used (see below), a single 23LC1024 RAM chip is used, with these pins:
Pin | Signal |
---|---|
6 | CS |
7 | MOSI |
12 | MISO |
14 | SCK |
When AUDIO_MEMORY_MEMORYBOARD is used, up to six 23LC1024 chips are used.
Pin | Signal |
---|---|
2 | CS0 (encoded) |
3 | CS1 (encoded) |
4 | CS2 (encoded) |
7 | MOSI |
12 | MISO |
14 | SCK |
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.
Demo Video (YouTube)
Forum Conversaton (with sample code)
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);