Lesson 14 of 15

Low-Frequency Oscillator

LFO — Low-Frequency Oscillator

A Low-Frequency Oscillator (LFO) is a sine wave oscillating too slowly to hear as pitch (typically 0.1–20 Hz). Instead, it modulates other parameters over time to create effects.

LFO Formula

lfoValue(t, rate, depth) = depth × sin(2π × rate × t)
  • t — time in seconds
  • rate — oscillation frequency in Hz
  • depth — amplitude (range: −depth to +depth)

Common LFO Uses

Modulation targetEffect
GainTremolo (volume wobble)
PitchVibrato (pitch wobble)
Filter cutoffWah / auto-wah
PanAuto-pan

Example: Tremolo at 4 Hz, depth 0.4

The gain oscillates between 0.1 and 0.9 four times per second.

Your Task

Implement lfoValue(t, rate, depth) returning the oscillator value.

Run your code to hear tremolo (LFO applied to gain).

Web Audio API loading...
Loading...
Click "Run" to execute your code.