Tone.LFO

↳ EXTENDS Tone.Oscillator

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

.state

↝ Tone.State READONLY #

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

</>

.units

↝ Tone.Type #

The output units of the LFO.

</>
∿

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

</>
∿

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

</>

.phase

↝ number #

The phase of the LFO.

</>

.type

↝ string #

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

</>
↳ inherited from Tone.Oscillator

.partials

↝ Array #

The partials of the waveform. A partial represents the amplitude at a harmonic. The first harmonic is the fundamental frequency, the second is the octave and so on following the harmonic series. Setting this value will automatically set the type to “custom”. The value is an empty array when the type is not “custom”.

EXAMPLE

osc.partials = [1, 0.2, 0.01];
</>
↳ inherited from Tone.Oscillator
∿

.detune

↝ Cents #

The detune control signal.

</>
↳ inherited from Tone.Source
∿

.volume

↝ Decibels #

The volume of the output in decibels.

EXAMPLE

source.volume.value = -6;
</>

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

.syncFrequency ( )

#
↪ returns Tone.Oscillator

this

Sync the signal to the Transport’s bpm. Any changes to the transports bpm, will also affect the oscillators frequency.

EXAMPLE

Tone.Transport.bpm.value = 120;
osc.frequency.value = 440;
//the ration between the bpm and the frequency will be maintained
osc.syncFrequency();
Tone.Transport.bpm.value = 240; 
// the frequency of the oscillator is doubled to 880
</>
↳ inherited from Tone.Oscillator

.unsyncFrequency ( )

#
↪ returns Tone.Oscillator

this

Unsync the oscillator’s frequency from the Transport. See Tone.Oscillator.syncFrequency

</>
docs generated Sep 15 2019