Theremin Waves
Move your mouse over the canvas to play an invisible instrument. Horizontal position controls pitch (200–2000 Hz), vertical position controls volume. The oscilloscope shows the raw audio waveform in real time, and the frequency spectrum below reveals the harmonic content of each sound — the fingerprint that makes a sawtooth wave buzz and a sine wave sing pure.
f(x) = A · sin(2πft) | spectrum: FFT of signal → magnitude vs frequency
Oscilloscope
Click to enable audio
Frequency Spectrum (FFT)
The theremin
Invented by Léon Theremin in 1920, the theremin was the first electronic instrument and remains the only one played without physical contact. Two antennas sense the proximity of the player's hands: the right hand controls pitch via a vertical antenna, and the left hand controls volume via a horizontal loop. The antennas form part of LC oscillator circuits whose capacitance changes with hand distance, producing a heterodyne frequency difference that becomes the audible tone.
Waveform visualization
The top canvas shows the oscilloscope view — the raw audio signal as amplitude over time. A sine wave appears as a smooth curve, a square wave as sharp steps, a sawtooth as diagonal ramps, and a triangle as pointed zigzags. The oscilloscope uses zero-crossing triggering to keep the display stable at any frequency.
Frequency spectrum (FFT)
The bottom canvas shows the Fast Fourier Transform of the audio signal — decomposing the waveform into its constituent frequencies. A pure sine wave shows a single peak. A sawtooth wave shows all harmonics (2f, 3f, 4f...) with amplitudes falling off as 1/n. A square wave shows only odd harmonics (3f, 5f, 7f...) falling off as 1/n. This spectral fingerprint is what gives each waveform its characteristic timbre.
Note detection
The note display uses 12-tone equal temperament, where each semitone is a factor of 21/12 ≈ 1.05946 apart. The MIDI note number is calculated as n = 69 + 12 · log2(f / 440), giving A4 = 440 Hz as the reference. The cents deviation shows how far the current pitch is from the nearest note — ±50 cents spans one semitone.
Controls
Vibrato adds a low-frequency oscillation to the pitch, mimicking the natural tremolo of a singer's voice. The vibrato amount slider controls the depth in Hz. Glide speed (portamento) controls how quickly the pitch slides from one note to the next — shorter times give snappy response, longer times create smooth, legato transitions. Reverb adds spatial depth using a convolution reverb with a synthetic impulse response.