Reference p5.Delay

p5.Delay

Delay is an echo effect. It processes an existing sound source, and outputs a delayed version of that sound. The p5.Delay can produce different effects depending on the delayTime, feedback, filter, and type. In the example below, a feedback of 0.5 (the default value) will produce a looping delay that decreases in volume by 50% each repeat. A filter will cut out the high frequencies so that the delay does not sound as piercing as the original source.

This class extends p5.Effect. Methods amp(), chain(), drywet(), connect(), and disconnect() are available.

Examples

Fields

leftDelay

The p5.Delay is built with two Web Audio Delay Nodes, one for each stereo channel.

rightDelay

The p5.Delay is built with two Web Audio Delay Nodes, one for each stereo channel.

Methods

process

Add delay to an audio signal according to a set of delay parameters.

delayTime

Set the delay (echo) time, in seconds. Usually this value will be a floating point number between 0.0 and 1.0.

feedback

Feedback occurs when Delay sends its signal back through its input in a loop. The feedback amount determines how much signal to send each time through the loop. A feedback greater than 1.0 is not desirable because it will increase the overall output each time through the loop, creating an infinite feedback loop. The default value is 0.5

filter

Set a lowpass filter frequency for the delay. A lowpass filter will cut off any frequencies higher than the filter frequency.

setType

Choose a preset type of delay. 'pingPong' bounces the signal from the left to the right channel to produce a stereo effect. Any other parameter will revert to the default delay setting.

amp

Set the output level of the delay effect.

connect

Send output to a p5.sound or web audio object

disconnect

Disconnect all output.

Notice any errors or typos? Please let us know. Please feel free to edit lib/addons/p5.sound.js and open a pull request!

Related References