Skip to content
Tone.js

LFO

class Source ↳ extends ToneAudioNode<LFOOptions>

LFO stands for low frequency oscillator. LFO produces an output signal which can be attached to an AudioParam or Tone.Signal in order to modulate that parameter with an oscillator. The LFO can also be synced to the transport to start/stop and change when the tempo changes.

return Tone.Offline(() => {
	const lfo = new Tone.LFO("4n", 400, 4000).start().toDestination();
}, 0.5, 1);
new LFO(frequency?: Frequency, min?: number, max?: number)

Parameters

  • frequency Frequency optional

    The frequency of the oscillation. Typically, LFOs will be in the frequency range of 0.1 to 10 hertz.

  • min number optional

    The minimum output value of the LFO.

  • max number optional

    The maximum value of the LFO.

new LFO(options?: Partial<LFOOptions>)

Parameters

read-only

amplitude: Param<"normalRange">

The amplitude of the LFO, which controls the output range between the min and max output. For example if the min is -10 and the max is 10, setting the amplitude to 0.5 would make the LFO modulate between -5 and 5.

convert: boolean

If the input value is converted using the units

Default: true

read-only

frequency: Signal<"frequency">

The frequency value of the LFO

read-only

input: undefined

There is no input node

read-only

name: string

The name of the class

Default: "LFO"

read-only

output: OutputNode

The output of the LFO

max: number

The maximum output of the LFO.

min: number

The minimum output of the LFO.

partials: number[]

The oscillator’s partials array.

See also: Oscillator.partials

phase: number

The phase of the LFO.

read-only

Returns the playback state of the source, either “started” or “stopped”.

The type of the oscillator.

See also: Oscillator.type

units: keyof UnitMap

The output units of the LFO.

connect(node: InputNode, outputNum?: number, inputNum?: number): this

Parameters

  • node InputNode

    the destination to connect to

  • outputNum number optional

    the optional output number

  • inputNum number optional

    the input number

Returns this

disconnect(destination?: InputNode, outputNum?: number, inputNum?: number): this

Disconnect the LFO.

Parameters

  • destination InputNode optional
  • outputNum number optional default 0
  • inputNum number optional default 0

Returns this

dispose(): this

Dispose and disconnect

Returns this

start(time?: Time): this

Start the LFO.

Parameters

  • time Time optional

    The time the LFO will start

Returns this

stop(time?: Time): this

Stop the LFO.

Parameters

  • time Time optional

    The time the LFO will stop

Returns this

sync(): this

Sync the start/stop/pause to the transport and the frequency to the bpm of the transport

const lfo = new Tone.LFO("8n");
lfo.sync().start(0);
// the rate of the LFO will always be an eighth note, even as the tempo changes

Returns this

unsync(): this

unsync the LFO from transport control

Returns this

static

getDefaults(): LFOOptions

Returns all of the default options belonging to the class.

Returns LFOOptions