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.

</>

.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.

</>

.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.

</>
inherited from Tone.AudioNode

.channelCount

Number READONLY #

channelCount is the number of channels used when up-mixing and down-mixing connections to any inputs to the node. The default value is 2 except for specific nodes where its value is specially determined.

</>
inherited from Tone.AudioNode

.channelCountMode

String READONLY #

channelCountMode determines how channels will be counted when up-mixing and down-mixing connections to any inputs to the node. The default value is “max”. This attribute has no effect for nodes with no inputs.

</>
inherited from Tone.AudioNode

.channelInterpretation

String READONLY #

channelInterpretation determines how individual channels will be treated when up-mixing and down-mixing connections to any inputs to the node. The default value is “speakers”.

</>
inherited from Tone.AudioNode

.context

Tone.Context READONLY #

Get the audio context belonging to this instance.

</>
inherited from Tone.AudioNode

.numberOfInputs

Number READONLY #

The number of inputs feeding into the AudioNode. For source nodes, this will be 0.

</>
inherited from Tone.AudioNode

.numberOfOutputs

Number READONLY #

The number of outputs coming out of the AudioNode.

</>

Methods

.unsync ( )

#
↪ returns Tone.LFO

this

unsync the LFO from transport control

</>

.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
</>
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();
</>
inherited from Tone.AudioNode

.fan ( )

#
nodes
↪ returns Tone.AudioNode

this

connect the output of this node to the rest of the nodes in parallel.

</>
inherited from Tone.AudioNode

.chain ( )

#
nodes
↪ returns Tone.AudioNode

this

Connect the output of this node to the rest of the nodes in series.

EXAMPLE

//connect a node to an effect, panVol and then to the master output
 node.chain(effect, panVol, Tone.Master);
 
</>
docs generated Sep 15 2019