Tone.LFO
↳ EXTENDS Tone.OscillatorLFO 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 ( [DEFAULTS
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”.
.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.
.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];.volume
↝ Decibels #The volume of the output in decibels.
EXAMPLE
source.volume.value = -6;Methods
.start ( )
#Start the LFO.
.stop ( )
#Stop the LFO.
.sync ( )
#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.syncFrequency ( )
#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.unsyncFrequency ( )
#this
Unsync the oscillator’s frequency from the Transport. See Tone.Oscillator.syncFrequency