builtins

Visualizations

Inline visualizations that render directly in the editor. Each visualization is inserted as a pass-through node in the signal chain — the audio passes throug…

Inline visualizations that render directly in the editor. Each visualization is inserted as a pass-through node in the signal chain — the audio passes through unchanged while being displayed.

All visualization functions accept an optional name string and an options record. Common options shared by all types:

OptionTypeDefaultDescription
widthnumber / string200Width in pixels, or "100%" for full width
heightnumber / string50Height in pixels, or "100%" for full height

oscilloscope

Oscilloscope - Time-domain waveform display with trigger stabilization.

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

Options:

OptionTypeDefaultDescription
triggerLevelnumber0Amplitude threshold for trigger
triggerEdgestring"rising"Trigger edge: "rising" or "falling"

Displays a real-time oscilloscope view of the signal. The trigger stabilizes the waveform so it doesn’t drift horizontally. Set triggerLevel to the amplitude where the waveform should “lock” and triggerEdge to choose which direction of crossing to trigger on.

// Basic oscilloscope
osc("sin", 440) |> oscilloscope(%) |> out(%, %)
// Named with trigger at zero-crossing
osc("saw", 110) |> oscilloscope(%, "saw wave", {triggerLevel: 0, triggerEdge: "rising"}) |> out(%, %)
// Wide display with falling edge trigger
osc("sqr", 220) |> oscilloscope(%, "square", {width: 400, triggerEdge: "falling"}) |> out(%, %)

Related: waveform, spectrum


waveform

Waveform - Time-domain envelope display showing min/max amplitude.

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

Options:

OptionTypeDefaultDescription
scalenumber1.0Amplitude multiplier (2.0 = zoom in 2x)
filledbooleantrueFilled envelope or line waveform

Displays the signal as a min/max envelope over time. In filled mode (default), shows a shaded region between the minimum and maximum amplitude at each point. In line mode (filled: false), draws a single center-line waveform similar to the oscilloscope.

// Basic waveform
osc("saw", 110) |> waveform(%) |> out(%, %)
// Zoomed in with line style
osc("sin", 440) * 0.3 |> waveform(%, "quiet signal", {scale: 3.0, filled: false}) |> out(%, %)
// Wide filled envelope
osc("saw", 55) |> lp(%, 400) |> waveform(%, "bass", {width: 400, height: 80}) |> out(%, %)

Related: oscilloscope, spectrum


spectrum

Spectrum Analyzer - Frequency-domain FFT display.

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

Options:

OptionTypeDefaultDescription
fftnumber1024FFT size: 256, 512, 1024, or 2048
logScalebooleanfalseLogarithmic frequency axis
minDbnumber-90Minimum dB for display range
maxDbnumber0Maximum dB for display range

Displays a real-time frequency spectrum using FFT analysis. Linear scale (default) spaces frequencies evenly; logarithmic scale (logScale: true) gives more detail to low frequencies, matching how we perceive pitch. Larger FFT sizes give better frequency resolution but slower updates.

// Basic spectrum
osc("saw", 220) |> spectrum(%) |> out(%, %)
// Log scale with custom dB range
osc("saw", 110) |> lp(%, 2000) |> spectrum(%, "filtered", {logScale: true, minDb: -60, maxDb: 0}) |> out(%, %)
// High resolution FFT
osc("saw", 55) |> spectrum(%, "bass detail", {fft: 2048, logScale: true, width: 400}) |> out(%, %)

Related: waterfall, oscilloscope


waterfall

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

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

Options:

OptionTypeDefaultDescription
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

Displays a scrolling spectrogram where the x-axis is time, the y-axis is frequency, and color represents amplitude. Available gradient presets: "magma", "viridis", "inferno", "thermal", "grayscale".

The default size for waterfall is 300x150 (larger than other visualizations).

// Basic waterfall
osc("saw", 220) |> waterfall(%) |> out(%, %)
// Viridis gradient with high-res FFT
osc("saw", 110) |> lp(%, 1000 + osc("sin", 0.5) * 2000) |> waterfall(%, "sweep", {gradient: "viridis", fft: 2048}) |> out(%, %)
// Custom size and dB range
osc("saw", 55) |> waterfall(%, "bass", {width: 500, height: 200, minDb: -60, maxDb: 0, gradient: "thermal"}) |> out(%, %)

Related: spectrum


pianoroll

Piano Roll - Pattern event visualization on a pitch-time grid.

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

Options:

OptionTypeDefaultDescription
beatsnumberautoNumber of beats visible in the window
showGridbooleantrueShow beat grid lines
scalestring"chromatic"Scale filter: "chromatic", "pentatonic", or "octave"

Displays pattern events as rectangles on a piano roll grid. The playhead scrolls through the pattern in real time. The scale option dims notes that fall outside the selected scale, making it easy to see which notes are in-key. "pentatonic" highlights C major pentatonic (C, D, E, G, A); "octave" highlights only root notes (C).

// Basic piano roll
pat("c4 e4 g4 b4") |> pianoroll(%)
// Wide view with 8 beats visible
pat("c4 e4 g4 c5 ~ e4 g4 b4") |> pianoroll(%, "melody", {beats: 8, width: 400, height: 80})
// Pentatonic scale filter, no grid
pat("c4 d4 e4 f4 g4 a4 b4 c5") |> pianoroll(%, "scale check", {scale: "pentatonic", showGrid: false})

Related: oscilloscope, spectrum