Skip to content
Tone.js

Delay

class Core ↳ extends ToneAudioNode<DelayOptions>

Wrapper around Web Audio’s native DelayNode.

return Tone.Offline(() => {
	const delay = new Tone.Delay(0.1).toDestination();
	// connect the signal to both the delay and the destination
	const pulse = new Tone.PulseOscillator().connect(delay).toDestination();
	// start and stop the pulse
	pulse.start(0).stop(0.01);
}, 0.5, 1);
new Delay(delayTime?: Time, maxDelay?: Time)

Parameters

  • delayTime Time optional

    The delay applied to the incoming signal.

  • maxDelay Time optional

    The maximum delay time.

new Delay(options?: Partial<DelayOptions>)

Parameters

read-only

delayTime: Param<"time">

The amount of time the incoming signal is delayed.

const delay = new Tone.Delay().toDestination();
// modulate the delayTime between 0.1 and 1 seconds
const delayLFO = new Tone.LFO(0.5, 0.1, 1).start().connect(delay.delayTime);
const pulse = new Tone.PulseOscillator().connect(delay).start();
// the change in delayTime causes the pitch to go up and down

read-only

input: DelayNode

The input node or nodes. If the object is a source, it does not have any input and this.input is undefined.

read-only

name: string

The name of the class

Default: "Delay"

read-only

output: DelayNode

The output nodes. If the object is a sink, it does not have any output and this.output is undefined.

read-only

maxDelay: number

The maximum delay time. This cannot be changed after the value is passed into the constructor.

dispose(): this

Clean up.

Returns this

static

getDefaults(): DelayOptions

Returns all of the default options belonging to the class.

Returns DelayOptions