Eurorack modular synth with dangling patch cables
I wanted to know if one 2D canvas could draw three HTML form panels as Eurorack synthesiser modules, drape physical Verlet-simulated patch cables in front of them with cast shadows and a live oscilloscope, and still leave every slider, select and jack clickable and keyboard-accessible. Drag from one 3.5 mm jack to another (or tap two jacks in turn) to rewire the patch, and press Power inside the VCF module to start Web Audio.
Patched: VCO OUT to AUDIO IN, LFO OUT to CV IN. Sound is muted until you press Power.
Show the code three drawable fieldsets, Verlet cables and oscilloscope
- The rack markup. Three
drawable<fieldset>modules sit inside onelayoutsubtreecanvas. Every slider, select and jack button stays a standard HTML control. - Faceplate styling. CSS lays out the labels, sliders, recessed scope slot and 3.5 mm jack buttons inside each module.
- Responsive rack slots and five-argument draws. On wide screens the three modules sit side by side; below 660 px they stack into a two-row skiff under 4 megapixels at 2.625 scale. Each module is drawn with a five-argument
drawElementImage(). - Verlet patch cables drawn in front of the DOM. Each cable has 12 nodes with gravity, damping and distance constraints. Cast shadows, braided jackets and metallic plugs paint after
drawElementImage()so they hang visually over the controls without blocking hits. - Live oscilloscope and Web Audio patch graph. Pressing Power creates and resumes an
AudioContextrouted through anAnalyserNode. While muted, a synthetic preview trace reflects the active patch immediately on load. - Pointer drag and tap/keyboard patching. Dragging from one jack to another pulls a live dangling cable; tapping or pressing Enter on two jacks toggles the same connection without needing hover or drag.
How it works
The idea comes from hardware Eurorack modular synthesisers, VCV Rack's dangling patch cables, and two earlier experiments on this site: form controls drawn as instruments and the cassette deck from audio controls, which established that standard HTML form controls can be drawn inside a canvas as tactile audio hardware while keeping keyboard and touch input.
- One 2D canvas with
content="drawable" layoutsubtreeholds three<fieldset drawable>modules: VCO-1, LFO-1 and VCF/Mix. AResizeObserversizes the canvas backing store in device pixels and fits the modules into either one row (desktop) or two compact rows (narrow phones around 412 px). - Each frame paints the brushed-aluminium rails and M3 mounting screws first, then calls five-argument
drawElementImage(mod, x, y, w, h)for each module. That call both copies the module's live pixels and places its hit-test region at(x, y, w, h). - Next, the canvas draws the glowing phosphor oscilloscope waveform straight over the VCF module's recessed
.scope-slotbox, plus a pulsing LFO rate LED beside the LFO header. - Last, the canvas paints the cast drop shadows, braided jackets and 3.5 mm plugs of every active Verlet patch cable over the top of the drawn modules. Canvas strokes have no DOM hit box of their own, so clicks, drags and focus pass straight through a hanging cable to the sliders and selects behind it.
- Audio stays off on load. Clicking Power inside the VCF module creates and resumes an
AudioContext, wires the oscillator, LFO and biquad filter according to the active cables, and feeds the oscilloscope from anAnalyserNode. If the canvas loses its context or the API is missing, the three<fieldset>modules move into a plain CSS grid with every control still working.
Live checks
Each check builds its own isolated fixture on testStage() and copies pixels into a plain 2D canvas to read them. The visible synth above isn't touched until the final check inspects whether it still has pixels.
| Result | Experiment | Detail |
|---|
Findings
Built 2026-11-22. Live browser rendering, Android touch patching and Web Audio output are not verified yet; run the checks above in Chrome with HTML-in-canvas enabled to measure your browser.
- Prior work credited: this layout builds on hardware Eurorack synthesisers, VCV Rack's dangling patch cables, and /instruments/ plus /cassette/ on this site.
- Design: cables in front, hit boxes underneath. Because 2D canvas paths painted after
drawElementImage()don't alter the element's hit-test transform, dangling cables can cross directly over range sliders and<select>menus without stealing taps. Lower the Cable opacity slider to inspect the overlap. - Design: phone pixel budget. At 412 CSS px wide and scale 2.625, the two-row skiff is 590 CSS px tall (about 1.68 megapixels, well under the 4-megapixel guard limit).
- Not verified: live rendering in Chromium 157 headless and Chrome 159 on Android, touch drag patching vs. page scroll on Android, native
<select>popup anchoring inside a drawn<fieldset>, and real-time Web Audio output withAnalyserNode.