Skip to content

refactor(web/config): separate shared config from web-only block + version it#266

Open
ryanontheinside wants to merge 1 commit into
mainfrom
refactor/shareable-config
Open

refactor(web/config): separate shared config from web-only block + version it#266
ryanontheinside wants to merge 1 commit into
mainfrom
refactor/shareable-config

Conversation

@ryanontheinside

@ryanontheinside ryanontheinside commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

What

Splits the rtmg web demo's config.json into a portable shared config object and a browser-demo-only web block, and adds a version field.

  • Shared (top-level): version, engine, prompts, controls, channel_ranges, seed, swap_source_mode — engine/generation intent plus the control surface that any frontend driving DEMON consumes.
  • web block: effects, audio (LUFS), reset_seconds, denoise_session_gate, restart_song_on_swap — browser-demo presentation/playback. Named web rather than ui because every frontend (VST, M4L, browser) has a UI; other frontends read the shared fields and keep their own equivalent of this block.
  • channel_ranges stays shared: per-channel {min,max,reverse} is a control-surface contract a native plugin's knob layout would honor, not web chrome.
  • Back-compat: normalizeConfigShape() lifts pre-web flat configs into the new shape on load/import, so older config.json files and exported sounds keep working.

Why

config.json mixed engine/generation intent with this demo's UI settings and had no schema version. The goal is one config object sharable across frontends (web demo, VST, Ableton M4L, MCP/headless).

Tests

  • tsc --noEmit clean
  • 47 web unit tests pass
  • The replay tier has a pre-existing failure on main (stale telemetry fields in canonical fixtures), unrelated to this change.

Companion

Mirrored in the public demo: daydreamlive/demon-public-demo#357

…rsion it

config.json mixed engine/generation intent with this demo's UI settings and
had no schema version. Split it so the config object is portable across
frontends (web demo, VST, Ableton M4L, MCP/headless):

- Add top-level `version` to tag the shared schema.
- Shared (top-level): engine, prompts, controls, channel_ranges, seed,
  swap_source_mode. channel_ranges stays shared because per-channel
  {min,max,reverse} is a control-surface contract a native plugin's knob
  layout would also honor, not web chrome.
- `web` block (browser-demo-only): effects, audio (LUFS), reset_seconds,
  denoise_session_gate, restart_song_on_swap. Named `web` rather than `ui`
  since every frontend has a UI; other frontends ignore this block.
- normalizeConfigShape() lifts a pre-`web` flat config into the new shape on
  load/import, so older config.json files and exported sounds keep working.

Updated all consumers (useRenderLoop, useFixtureSwap, useStartSession,
PerformanceShell) and the type/merge/apply/capture paths in lib/config.ts.

typecheck clean; 47 unit tests pass. (replay tier has a pre-existing failure
on main, unrelated to this change.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant