Scope Lab
2026 · Rust · WebAssembly · WebGL2 · Web Audio · How this site works
The Spectrogram Lab hides pictures in time and pitch. Oscilloscope music puts geometry directly into the waveform: plug a stereo audio cable into an analog oscilloscope in X–Y mode, send the left channel to horizontal deflection and the right channel to vertical deflection, and the electron beam draws whatever the two channels trace together. The Scope Lab is both sides of that tube. Spin a 4D tesseract, a torus, the JM-01 cyberdeck, vector words or your own freehand drawing and press sound to hear the exact stereo audio drawing it — or drop any stereo oscilloscope track onto the glass to watch it come alive. Nothing is uploaded, and a patch travels in its link.
Seeing the sound, literally
Nothing on the CRT is drawn from a 2D canvas behind the scenes. Every glowing stroke comes directly from consecutive stereo audio samples (L_{n-1}, R_{n-1}) \to (L_n, R_n) emerging from the AudioWorklet (or from the stereo channels of a file you drop). Look at the L → X / R → Y strip beneath the tube while a shape spins: a circle is a sine on the left and a cosine on the right; a tilted cube turns both channels into sharp piecewise ramps rich in odd and even harmonics.
That link between shape and sound is what makes oscilloscope music (pioneered by Jerobeam Fenderson, Hansi Raber and the Vectrex demoscene) uncanny:
- Smooth closed curves like torus and knot have no sudden corners, so they sing like a warm detuned synth.
- Sharp polyhedra like tesseract, cube and jm-01 turn the beam abruptly at every vertex, adding bright buzz and metallic overtones that shift continuously as you drag and rotate the object in 3D.
- Pitch is simply how many times per second the beam completes one full loop of the figure: 82.4 Hz (E2) sweeps the entire wireframe 82 times every second, giving ~580 samples per cycle at 48 kHz — plenty of resolution for complex 3D geometry.
Velocity, flyback and phosphor
On a real CRT, an electron beam deposits energy inversely proportional to how fast it moves across the phosphor. Slow edges and corners where the beam lingers or reverses burn white-hot; rapid jumps between disconnected edges spread the same electrons over hundreds of pixels and fade into ghostly retrace hairlines.
To keep jumps brief without wasting audio bandwidth, the Rust engine stitches each wireframe's edges into the fewest continuous trails using a greedy Eulerian walk, spends cycle phase proportional to 2D arc length on drawn edges, and zips across disconnected jumps in a tiny sliver of phase. The WebGL2 renderer then shades every sample pair with brightness proportional to 1 / (\|\Delta p\| + c), adds it into a ping-pong RGBA16F persistence buffer so trails decay exponentially like real P3 amber or P1 green phosphor, and composites it with soft bloom and a glass graticule.
Plugging into real hardware
Download WAV renders eight seconds of clean 48 kHz 16-bit stereo PCM straight from scope.wasm. Play that file out of a headphone jack or DC-coupled audio interface into an X–Y oscilloscope (or drop it back into this page) and the spinning tesseract, cyberdeck or signature appears on real glass.
How it's built
The synthesizer is a zero-dependency Rust crate compiled to a 51 KB WebAssembly module with no bindings. When sound is on, the module runs inside an AudioWorklet (like the Chiptune Lab) rendering 128 stereo frames per quantum and posting exact 1024-sample tap buffers back to WebGL2. When sound is muted, a second copy steps silently on the main thread so the tube opens alive immediately.
A built-in single-stroke Hershey-style vector font handles text, and tesseract rotates its sixteen 4D vertices in the XW and YW planes before projecting to 3D and then 2D. Dragging twist spirals the 3D vertices around the vertical axis, wobble ripples them radially, and fm buzz modulates the beam's phase velocity at twice the fundamental frequency.
Back to Labs · hide pictures in pitch in the Spectrogram Lab · write a tune in the Chiptune Lab · inspect the cyberdeck in JM-01 Cyberdeck · see how this site works.