builtins

Waterfall

A scrolling spectrogram visualizer: time on one axis, frequency on the other, color for amplitude. It sits in the chain as a pass-through, so audio flows thr…

A scrolling spectrogram visualizer: time on one axis, frequency on the other, color for amplitude. It sits in the chain as a pass-through, so audio flows through unchanged.

waterfall

Waterfall / Spectrogram - Time-frequency display showing spectrum evolution over time.

ParamTypeDescription
insignalInput signal
namestringDisplay label (optional)
optsrecordOptions (optional)

Options:

OptionTypeDefaultDescription
widthnumber / string300Width in pixels, or "100%" for full width
heightnumber / string150Height in pixels, or "100%" for full height
fftnumber1024FFT size: 256, 512, 1024, or 2048
gradientstring"magma"Color gradient preset
anglenumber180Scroll direction in degrees
speednumber40Scroll speed in pixels per second
minDbnumber-90Minimum dB for color mapping
maxDbnumber0Maximum dB for color mapping

The default size is 300×150 (larger than the other visualizations).

// Basic waterfall
osc("saw", 220) |> waterfall(%) |> out(%, %)

gradient

Color gradient preset. Available presets: "magma" (default), "viridis", "inferno", "thermal", "grayscale".

// Viridis gradient
osc("saw", 110) |> lp(%, 1000 + osc("sin", 0.5) * 2000) |> waterfall(%, "sweep", {gradient: "viridis"}) |> out(%, %)

magma

Default warm-to-cool gradient with deep purple at low energy and yellow at high. Good general-purpose contrast.

viridis

Perceptually-uniform gradient (purple-green-yellow). Easy to read for color-vision-deficient viewers.

inferno

Black-red-yellow gradient. High contrast for finding peaks.

thermal

Black-blue-cyan-yellow-red. Mimics a thermal camera readout.

grayscale

Pure black-to-white gradient. Useful for prints or when overlaying with other visualizations.

angle

Scroll direction in degrees. 180 (default) scrolls left to right; 0 scrolls right to left; 90 and 270 give vertical scroll.

speed

Scroll speed in pixels per second. Lower values give a longer history; higher values respond faster to recent activity.

// Slow scroll, large display
osc("saw", 55) |> waterfall(%, "bass", {speed: 15, width: 500, height: 200, gradient: "thermal"}) |> out(%, %)

Related: spectrum, oscilloscope