Skip to content

Oscilloscope

A two-trace oscilloscope with fading persistence next to an XY scope drawing a rotating Lissajous figure

ui.audio.Scope(traces=[osc.scope(1024), lfo.scope(1024)], width=320, height=180)

traces is a list of signals (or a single list of numbers), each drawn in the next color of colors. With trigger=True each trace starts at the first point where the wave rises through zero, so a steady tone stands still instead of drifting. window is how many samples are shown.

xy=True draws the first trace against the second: the first moves the dot left and right, the second up and down. Two sines make Lissajous figures; a stereo pair (left, right) shows how wide the stereo image is — a vertical line is mono, a cloud is wide.

persistence=3 leaves fading copies of the last three frames, like the glow of an old CRT screen; glow=True adds a soft halo around the newest trace.

Property Default What it does
traces () Signals to draw (−1..1).
width, height 320, 180 Size in pixels.
colors "scope" A palette name or a list (one color per trace).
background "#0b120e" The screen.
columns, rows 8, 6 Divisions of the grid.
gain 1 Vertical zoom.
trigger, window True, 512 Holds periodic waves still; samples shown.
xy False Lissajous mode.
persistence, glow 0, True Fading copies and halo.