LIVE cartercole.net --:--:-- UTC

// 04 RESTRICTED

vdj

JAVASCRIPT WEBGL2 GLSL ACCESS RESTRICTED

A browser VJ engine for beat-locked visual loops. One musical clock, anchored to wall time so a dropped frame never desyncs it, drives shader time, video playback rate, canvas animation, effect pulses and crossfades, with one Strudel cycle as one bar. Two decks and a crossfader play five layer types: GLSL shaders, GOLF shorthand transpiled in the browser, all-intra MP4 loops, canvas modules, and any same-origin page captured and chroma-keyed. A model writes new loops on request. No build step and no npm dependencies. Its code was later merged into dj-acme.

Shaders from a prompt

GENERATE asks a model for a loop (a local OpenAI-compatible endpoint, OpenAI or Anthropic), compiles it, drops it on the hidden deck and crossfades in, then keeps the conversation so the next message can tweak it in place. If it fails to compile, the compiler's log goes back with line numbers rebased onto the model's own source, for two attempts, and the previous program stays on screen throughout: a failed tweak never blacks out the projector. Any uniform float p_name; // min max default label the model declares becomes a slider.

Keys stay on the server and never reach the browser. Testing against a live local model found two bugs: CORS * on every path, which let any web page POST to the model endpoints (now scoped to /beat), and reasoning models streaming their thinking in a separate field, which made the panel look hung (now shown as live progress).

Strudel at arm's length

Strudel is AGPL, so the engine never imports it. A snippet pasted into strudel.cc hooks every pattern event and POSTs {cycle, cps, sound} to /beat; the server relays it over server-sent events and the clock re-anchors, gliding when close and snapping when far. Kicks fire a beat pulse, claps and snares an invert flash. The other sync sources are a set tempo with tap, and microphone analysis with kick detection, which also hands shaders a 512-wide scrolling spectrogram texture and bass, mid and high bands.

Video is normalized to H.264 with every frame a keyframe, so seeks are instant and loops are clean. The canvas loops are checked at 0, 60, 600 and 3600 seconds to stay bounded, because a deck runs for hours.

Stated honestly

The bundled library is small and all original or CC0: four GLSL loops, one GOLF demo, four canvas loops and a generated test pattern. The CC0 video loops it is built to ingest were never downloaded, so the video path has been checked against the test pattern only. It runs locally and is not deployed.