Commit Graph

159 Commits

Author SHA1 Message Date
Dejvino
59180948d0 Phase 5: compositing depth ("C" complete)
Multi-layer stacks with blend modes, feedback, post chain, and a 3D
particle layer proving the compositor is genuinely hybrid. Looks now
generate accent layers from a different family, composited additively at
low opacity, weighted by section energy so intros stay sparse.

Adds flash-rate safety (engine/flash.js), which was not in the original
plan and should have been. This generates beat-reactive video for
publication, and rapid light-dark cycling is the photosensitive-epilepsy
trigger; WCAG 2.3.1 caps it at three flashes per second. Classic Wave
measured 7-8/s at every output resolution from 96x54 to 1920x1080, so it
was a real hazard rather than a sampling artefact.

Root cause was general, not one bad shader: `u_time * u_speed` where speed
is reactively modulated. Phase is elapsed*rate, so changing the rate at
time T jumps phase by T*delta — sixty seconds in, a 0.05 wobble throws the
phase three whole units between consecutive frames, and it worsens as the
track runs. Fixed by introducing rate params:

- schema flag `rate: true` documents and marks them
- Layer.resolveParams skips reactivity on them
- ArcDriver skips drift on them
- validateModule rejects a reactive entry on one
- lint-scenes greps shaders for `u_time * u_X` and fails if X is unmarked,
  so no future scene can reintroduce it

Every rate param across the six scenes is now marked. Two checks were
needed to find this: a per-look flash check, and a per-SCENE sweep at
aggressive params, since the look generator only samples part of the space
and a scene can hide an unsafe region for a long time.

Gate 10/10. Worst flash rate now 1/s. Feedback stable over 10,000 frames
(luminance 0.17-0.59, no saturation or decay). 0.17ms/frame at 1280x720.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-05 11:38:26 +02:00
Dejvino
5f25437b89 Phase 4: arc driver ("C" brain)
Three timescales now stack: per-frame reactivity, per-section seeded LFO
drift, and whole-song scene changes with lookahead. Layer instances are
cached per section and reused across crossfades — rebuilding them per frame
would recompile shaders every transition.

Crossfades run forward from a boundary: the outgoing scene holds while the
incoming one fades in over it.

Three real bugs, each found by a check that had to be rewritten first:

1. A pop exactly at every transition. buildSlope is discontinuous by
   construction (~1 before a boundary, 0 after), and the outgoing layer is
   still on screen when it flips — collapsing its lookahead ramp in one
   frame. It now holds the slope it had entering the boundary.

2. FeatureTrack.at() returns a REUSED row object, and _boundarySlope()
   called at() again mid-render, rewriting the features the layer was about
   to read. Symptom: a frame correct on every repeat and wrong the first
   time — invisible to fresh-vs-fresh comparison, and wrong in every export,
   since export renders each frame exactly once. Now indexes the typed array
   directly, with the aliasing hazard documented on at(), and a new check
   covers the whole bug class.

3. Warm-up converged to 1%, leaving a visible 0.015 difference at heavy
   feedback settings. Now targets 0.1%.

Two checks were themselves wrong and were rebuilt: a raw delta threshold
and an outlier-vs-local-median test both flag beat flashes as pops, and a
control window taken from a different scene reads an ordinary busy scene as
a 9x spike. The working formulation A/Bs each boundary against the interior
of the two scenes adjacent to it.

PLAN.md §6 corrected: boundary seeks are NOT exact for free. Layer state is
re-seeded there but the feedback buffer is global and carries across.
Clearing it at boundaries would buy exactness for a visible flash at every
transition; warm-up is the better trade and applies everywhere.

Gate 9/9.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-05 11:30:50 +02:00
Dejvino
022c267888 Phase 3: look generation ("A" complete)
A track now yields a complete, coherent look with no input: palette,
per-section scene assignments, parameter sets, post and feedback settings.
Seeded from a hash of the decoded PCM, so a file always renders identically.

- palette.js builds in OKLCH, not HSL. HSL lightness is not perceptual, so
  evenly-stepped HSL palettes have colours that vanish and colours that
  dominate — which matters when nobody is supervising the choice.
  Regenerates until the contrast floor is cleared.
- Scenes are assigned per section KIND, not per section: a track's drops
  share a scene and the video reads as one piece instead of a shuffle.
- Family preference per kind keeps breakdowns off strobing glitch scenes.
- Section bias (energy/density/motion) carries track character into params
  without scenes knowing anything about audio.
- PaletteSource is the seam for cover art later; no scene would change.

Gate 9/9, including the look-space spread measurement (mean pairwise
distance 0.168 against a 0.08 floor) — the one check that catches a
generator that is deterministic and valid but visually collapsed.

Known gap, not a regression: all four battery tracks currently choose the
same two scenes. There are no 'minimal' family scenes yet, so intro and
outro sections fall through to flow/organic. Differentiation is presently
carried by palette alone. Phase 7 grows the library to fix it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-05 11:18:37 +02:00
Dejvino
c9b80308d2 Phase 2: param schema, auto-binding, generated UI
All five party-stage shaders now ported. Each declares its params
declaratively; uniform binding, UI controls, seeded sampling and arc
automation all derive from that one block, so a new scene costs a shader
and a schema and nothing else.

Port changes: LED-grid masks stripped, hardcoded colours replaced with
palette lookups, magic numbers lifted into params. Psychedelic Drift's
internal 15-second scene timer removed — keeping the visuals moving is the
arc driver's job, and it knows where the song's real transitions are.

ParamPanel generates controls from the schema alone and knows about no
specific scene; a hand-written control would be a bug.

Gate 8/8: schemas valid, uniforms accounted for in both directions, all
scenes compile and render, 128 range-sweep frames with no black, blown or
flat results, every param exposed in the UI, edits clamped, presets
round-trip and survive schema drift.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-05 11:14:04 +02:00
Dejvino
cb320557e6 Phase 1: offline audio pipeline
Whole-track analysis into a frame-indexed FeatureTrack. Nothing reads a
live AnalyserNode: realtime preview maps currentTime to a frame index,
export counts frames, both read the same rows.

- fft.js: radix-2 with precomputed tables, allocated once per track
- analyze.js: STFT at hop 1/60s with CENTRED windows (a window that starts
  at the timestamp reports energy arriving up to 23ms later, which reads as
  visuals lagging the music). Energy features normalised against the track's
  own percentiles; absolute stats kept in summary for the look generator.
- tempo.js: autocorrelation + grid F-measure, beat grid, downbeats
- segment.js: self-similarity novelty, boundaries snapped to the bar grid
- FeatureTrack: assembles everything, plus the lookahead fields. buildSlope
  rises through the bars leading into a higher-energy section, so a build can
  ramp into the drop rather than react after it lands.
- clicktrack.js: mixes clicks onto the detected grid for validation by ear

Three real bugs found and fixed by the tests:
- 174 BPM read as 87. Mean-energy-per-beat scores a half-tempo grid
  identically to the true one; only an F-measure penalises the missed
  onsets via recall.
- 90 BPM read as 180. Offbeat hi-hats make a double-tempo grid score
  perfectly on both precision and recall, so the grid is now interpreted
  metrically afterwards: a systematic strong/weak alternation means the
  real beat is every other grid point.
- Beat grid drifted ~30ms over 30s from integer-frame offsets. Onset peaks
  are now parabolically interpolated and the grid least-squares fitted.

Gates: 11/11 node tests against synthetic ground truth (tempo within 2%
across 90-174 BPM, beat alignment under half a frame, segmentation within
2s of a known boundary, graceful on silence, 6-minute analysis in 1.0s);
5/5 browser checks including audio-driven vs fixed-step frame parity.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-05 11:10:01 +02:00
Dejvino
7e31c19d6e Phase 0: determinism spine
Engine core: Timeline (fixed dt, audio-mastered in realtime), seeded Rng,
Renderer, Layer/ShaderLayer/SceneLayer, Compositor with blend modes,
feedback and post chain.

Shader scenes are compiled against a fixed uniform contract and define only
`vec4 scene(vec2 uv, vec2 p)`, so adding a scene costs a shader plus a
params block. Deep Nebula ported from party-stage as the first one.

Gate passes, 7/7 in checks.html:
- 300 frames rendered twice are bit-identical
- a fresh Engine reproduces the same frames
- simulated dropped frames change nothing (proves dt is fixed)
- seek matches sequential playback
- 320x180 vs 1280x720 agree within 0.010 (limit 0.06)
- seeded rng reproducible, forked streams independent
- compositor reset clears feedback history

Static gates: no wall-clock or unseeded randomness in deterministic
directories; scene schemas and shader sources agree in both directions.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-05 10:59:30 +02:00
Dejvino
e8fb647f11 Plan: flow-state ambient/EDM video generator
Design document for a new generator that produces full-length, non-story
music videos from a track alone, with no sourced footage.

Core decisions:
- Deterministic engine: audio is analyzed up front into a frame-indexed
  feature table, so realtime preview and offline export render from the
  same code path and produce the same frames.
- Whole-song analysis enables lookahead, so builds can anticipate drops.
- Scenes declare their parameters in a schema, which drives uniform
  binding, generated UI, seeded per-track variation and arc automation.
- Hybrid compositor: fragment-shader and three.js layers in one stack.
- Preview is a first-class surface with section jumping, live param
  editing and segment test-renders.
- Forked from party-stage by copy, then fully detached.

Includes per-phase gates and the validation tooling they depend on.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-05 10:49:14 +02:00
Dejvino
070f4d6e01 Feature: Drugged Out Flow visualizer 2026-05-24 14:41:15 +02:00
Dejvino
887d3970ab Tweak: Synthwave run car 2026-05-24 14:28:35 +02:00
Dejvino
ec2465222c Feature: Synthwave visualizer 2026-05-24 14:17:53 +02:00
Dejvino
c6324d3ccd Feature: visualization selector 2026-05-24 14:08:38 +02:00
Dejvino
9aa12c3c33 Feature: image slideshow instead of videos 2026-05-24 13:45:10 +02:00
Dejvino
a6c8d9c8c6 distrobox as alternative runner 2026-03-08 16:59:22 +01:00
Dejvino
d00cf96ed7 Feature: more laser patterns 2026-01-06 21:41:22 +00:00
Dejvino
862acfd07f Tweak: guests movement limit 2026-01-06 21:37:39 +00:00
Dejvino
c56e07b083 Feature: organized guest modes 2026-01-06 21:19:27 +00:00
Dejvino
eef13e301c Feature: blackout raises opacity of projection screen to simulate strong relative light 2026-01-05 21:48:02 +00:00
Dejvino
cf6dda2d35 Feature: success and failure toast and greener buttons 2026-01-05 21:17:12 +00:00
Dejvino
89dc5db53c Feature: complex BPM detection via multiple approaches 2026-01-04 22:17:41 +00:00
Dejvino
48fa197b69 Fix: revert last commit 2026-01-04 21:42:26 +00:00
Dejvino
3c93956ff8 Tweak: stretch FFT graph x axis 2026-01-04 21:38:04 +00:00
Dejvino
db682996f0 Tweak: linear FFT graph 2026-01-04 21:35:08 +00:00
Dejvino
f79215cc15 Feature: spectrum analyzer that shows the beats detection will always be an aproximation 2026-01-04 21:33:23 +00:00
Dejvino
7e55f98da9 Feature: require real beats 2026-01-04 21:08:17 +00:00
Dejvino
767460e08c Feature: Scrolling song name in standby mode 2026-01-04 20:27:26 +00:00
Dejvino
31debfe151 Feature: Stage torches stop spitting flame when not loud but remain visible 2026-01-04 17:59:22 +00:00
Dejvino
ee6ae3a688 Fix: stuck audio in Chrome needs to be resumed on click due to security 2026-01-04 17:54:18 +00:00
Dejvino
b2166fe26a Tweak: blackout thresholds redo 2026-01-04 17:42:06 +00:00
Dejvino
997986917c Tweak: blackout thresholds (WIP) 2026-01-04 17:32:28 +00:00
Dejvino
cae867fd9f Tweak: Beat detection and blackout detection algos 2026-01-04 15:54:45 +00:00
Dejvino
7c18a3db11 Feature: FPS counter and memory tracker for performance investigations 2026-01-04 10:28:35 +00:00
Dejvino
4cd869791f Tweak: optimized guests collision detection 2026-01-04 10:12:00 +00:00
Dejvino
72a2fe7de2 Feature: blackout to emphasize music drops and calm sections 2026-01-04 10:09:04 +00:00
Dejvino
8b2d1aed53 Fix: Stage lights using stage colors 2026-01-04 07:29:43 +00:00
Dejvino
8bf82f5f8a Feature: Stage colors configurable and used everywhere 2026-01-04 07:26:27 +00:00
Dejvino
7296715a5e Feature: stage light bars 2026-01-04 07:04:28 +00:00
Dejvino
edbed229b3 Fix: torches toggle 2026-01-04 06:52:29 +00:00
Dejvino
47b7645046 Feature: DJ has a gameboy music controller 2026-01-04 06:47:21 +00:00
Dejvino
6b292b32ad Feature: configurable toggle for music console and count of guests 2026-01-04 06:28:28 +00:00
Dejvino
dcf12771d6 Feature: static stage lights before the show 2026-01-04 06:20:53 +00:00
Dejvino
066fcc26cc Feature: config UI split across Schedule and Venue panels 2026-01-04 06:17:57 +00:00
Dejvino
03474298a9 Feature: Custom poster for standby 2026-01-03 22:56:30 +00:00
Dejvino
e7931174de Feature: Config UI with persistent storage to tweak the visualizer 2026-01-03 22:51:13 +00:00
Dejvino
8ed8ea9d34 Feature: lasers synced to beat 2026-01-03 22:08:38 +00:00
Dejvino
2d570b8141 Feature: stage lasers fade in and out 2026-01-03 21:54:36 +00:00
Dejvino
3a7251e185 Feature: stage lasers 2026-01-03 21:42:55 +00:00
Dejvino
48fe11bf3f Fix: video playback pauses on end of song 2026-01-03 21:14:18 +00:00
Dejvino
0dc61d12d9 Tweak: projection screen pixels are opaque 2026-01-03 21:12:36 +00:00
Dejvino
0e9deaa161 Feature: projection side-screens 2026-01-03 20:30:48 +00:00
Dejvino
1586df7e51 Feature: anti-aliasing of projection screen 2026-01-03 20:21:53 +00:00