Tone.LFO

↳ EXTENDS Tone.AudioNode

LFO stands for low frequency oscillator. Tone.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.

CONSTRUCTOR

new Tone.LFO ( [
frequency
] , [
min
] , [
max
] )
frequency

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

optional
min

The minimum output value of the LFO.

type: number
optional
max

The maximum value of the LFO.

type: number
optional

DEFAULTS

{
type : sine ,
min : 0 ,
max : 1 ,
phase : 0 ,
frequency : 4n ,
amplitude : 1 ,
units : Tone.Type.Default
}

EXAMPLE

var lfo = new Tone.LFO("4n", 400, 4000);
lfo.connect(filter.frequency);

Members

.units

Tone.Type #

The output units of the LFO.

</>

.amplitude

Number #

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.

</>

.frequency

Frequency #

the lfo’s frequency

</>

.max

number #

The maximum output of the LFO.

</>

.min

number #

The miniumum output of the LFO.

</>

.mute

Boolean #

Mute the output.

</>

.phase

number #

The phase of the LFO.

</>

.state

Tone.State READONLY #

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

</>

.type

string #

The type of the oscillator: sine, square, sawtooth, triangle.

</>
inherited from Tone.AudioNode

.context

Tone.Context READONLY #

Get the audio context belonging to this instance.

</>

Methods

.dispose ( )

#
↪ returns Tone.LFO

this

disconnect and dispose

</>

.start ( )

#
time

the time the LFO will start

type: Time
default: now
↪ returns Tone.LFO

this

Start the LFO.

</>

.stop ( )

#
time

the time the LFO will stop

type: Time
default: now
↪ returns Tone.LFO

this

Stop the LFO.

</>

.sync ( )

#
↪ returns Tone.LFO

this

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

EXAMPLE

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

.unsync ( )

#
↪ returns Tone.LFO

this

unsync the LFO from transport control

</>
inherited from Tone.AudioNode

.disconnect ( )

#
output

Either the output index to disconnect if the output is an array, or the node to disconnect from.

↪ returns Tone.AudioNode

this

disconnect the output

</>
inherited from Tone.AudioNode

.toMaster ( )

#
↪ returns Tone.AudioNode

this

Connect ‘this’ to the master output. Shorthand for this.connect(Tone.Master)

EXAMPLE

//connect an oscillator to the master output
var osc = new Tone.Oscillator().toMaster();
</>
docs generated Sep 15 2019