← Back

Oscillators & Waveforms

An OscillatorNode generates a periodic waveform at a given frequency. The waveform shape determines the harmonic content — and therefore the timbre you hear.

Live oscillator

Select a waveform and adjust frequency and volume. The oscilloscope shows the actual audio signal in real time.

220 Hz
60 %
0 ¢
0 Hz2 kHz4 kHz6 kHz8 kHz

Waveform shapes

Each shape has a characteristic harmonic series. A sine is a single pure frequency. Square, sawtooth, and triangle are built from infinite sums of sine waves — their brightness comes from upper harmonics.

Sine

Single harmonic (fundamental only). Pure, smooth tone. Used for sub-bass and mellow lead sounds.

Square

Odd harmonics only (1, 3, 5…). Hollow, nasal sound — similar to a clarinet's timbre.

Sawtooth

All harmonics (1, 2, 3…) at decreasing amplitude. Bright, buzzy — the classic synth lead.

Triangle

Odd harmonics only, falling off faster than square. Softer than square, brighter than sine.

How it works

The audio clock runs at the sample rate of your hardware — typically 44,100 or 48,000 ticks per second. All timing for notes, envelopes, and effects is scheduled against this clock, which is why audio stays in sync even under heavy CPU load.
An oscillator generates a repeating waveform at a given frequency. Both the frequency and the pitch offset (detune) can be changed smoothly at any point — even while the sound is playing.
Detune shifts pitch in cents (hundredths of a semitone). 100 cents = 1 semitone. Two oscillators slightly detuned against each other create the classic "supersaw" chorus effect — the beating between them produces movement.
Volume is logarithmic. Halving the amplitude value does not halve the perceived loudness — human hearing compresses large differences. A square-law mapping (squaring the 0–1 slider value) gives a more natural-feeling volume control.