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);Constructor
Section titled “Constructor”new LFO(frequency?: Frequency, min?: number, max?: number)Parameters
-
frequency
FrequencyoptionalThe frequency of the oscillation. Typically, LFOs will be in the frequency range of 0.1 to 10 hertz.
-
min
numberoptionalThe minimum output value of the LFO.
-
max
numberoptionalThe maximum value of the LFO.
new LFO(options?: Partial<LFOOptions>)Parameters
- options
Partial<LFOOptions>optional
Properties
Section titled “Properties”amplitude
Section titled “amplitude”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
Section titled “convert”convert: booleanIf the input value is converted using the units
Default: true
frequency
Section titled “frequency”read-only
frequency: Signal<"frequency">The frequency value of the LFO
partials
Section titled “partials”partials: number[]The oscillator’s partials array.
See also: Oscillator.partials
read-only
state: BasicPlaybackStateReturns the playback state of the source, either “started” or “stopped”.
Methods
Section titled “Methods”connect()
Section titled “connect()”connect(node: InputNode, outputNum?: number, inputNum?: number): thisParameters
-
node
InputNodethe destination to connect to
-
outputNum
numberoptionalthe optional output number
-
inputNum
numberoptionalthe input number
Returns this
disconnect()
Section titled “disconnect()”disconnect(destination?: InputNode, outputNum?: number, inputNum?: number): thisDisconnect the LFO.
Parameters
- destination
InputNodeoptional - outputNum
numberoptional default0 - inputNum
numberoptional default0
Returns this
start()
Section titled “start()”start(time?: Time): thisStart the LFO.
Parameters
-
time
TimeoptionalThe time the LFO will start
Returns this
stop()
Section titled “stop()”stop(time?: Time): thisStop the LFO.
Parameters
-
time
TimeoptionalThe time the LFO will stop
Returns this
sync()
Section titled “sync()”sync(): thisSync 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 changesReturns this
getDefaults()
Section titled “getDefaults()”static
getDefaults(): LFOOptionsReturns all of the default options belonging to the class.
Returns LFOOptions
Inherited members
Section titled “Inherited members”- From
ToneWithContext: context, blockTime, sampleTime, get(), immediate(), now(), set(), toFrequency(), toSeconds(), toTicks() - From
Tone: debug, version, disposed, toString() - From
ToneAudioNode: channelCount, channelCountMode, channelInterpretation, numberOfInputs, numberOfOutputs, chain(), fan(), toDestination(), toMaster()