From 0fb6410be7b854352c676790e4006d23dc6932ff Mon Sep 17 00:00:00 2001 From: monsterrobotparty Date: Mon, 13 Jul 2026 12:15:38 +1000 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=8B=20godrum:=20build=20brief=20+=20de?= =?UTF-8?q?ploy-filter=20update=20(all=20*=5FBRIEF.md=20excluded)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- CLAUDE.md | 2 +- GODRUM_BRIEF.md | 462 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 463 insertions(+), 1 deletion(-) create mode 100644 GODRUM_BRIEF.md diff --git a/CLAUDE.md b/CLAUDE.md index b3bf848..e829f0a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,6 +1,6 @@ # Godstrument — Claude context -Music-instrument web app; hosted at godstrument.pro on the **botchat** VPS (`humanjing@100.71.119.27`, exposed via Cloudflare Tunnel — NOT dealgod, despite earlier notes). App dir `/home/humanjing/godstrument` (not a git checkout). Deploy = rsync git-tracked files only, **minus dev docs/scripts** (`--files-from=<(git ls-files | grep -vE '^(CLAUDE\.md|README\.md|ZERO_OMNI_BRIEF\.md|LIFESTRUMENT_BRIEF\.md|GODSTRUMENT_MANUAL_SOURCE\.md|godstrument\.txt|build_manual\.py|test_.*\.py)$')`, never `--delete`, never push `godstrument_users.db`/`auth_secret`/`patches/`) then `sudo -n systemctl restart godstrument`. The **user manual** ships as `viz/manual.html` (served at godstrument.pro/manual.html), generated from the in-app grimoire by `python3 build_manual.py` — re-run it after editing the grimoire. Working notes/planning docs stay OUT of the deploy. Origin is Gitea `ssh://git@100.71.119.27:222/monster/Godstrument.git`. See [[godstrument-pro-deploy]]. +Music-instrument web app; hosted at godstrument.pro on the **botchat** VPS (`humanjing@100.71.119.27`, exposed via Cloudflare Tunnel — NOT dealgod, despite earlier notes). App dir `/home/humanjing/godstrument` (not a git checkout). Deploy = rsync git-tracked files only, **minus dev docs/scripts** (`--files-from=<(git ls-files | grep -vE '^(CLAUDE\.md|README\.md|.*_BRIEF\.md|GODSTRUMENT_MANUAL_SOURCE\.md|godstrument\.txt|build_manual\.py|test_.*\.py)$')`, never `--delete`, never push `godstrument_users.db`/`auth_secret`/`patches/`) then `sudo -n systemctl restart godstrument`. The **user manual** ships as `viz/manual.html` (served at godstrument.pro/manual.html), generated from the in-app grimoire by `python3 build_manual.py` — re-run it after editing the grimoire. Working notes/planning docs stay OUT of the deploy. Origin is Gitea `ssh://git@100.71.119.27:222/monster/Godstrument.git`. See [[godstrument-pro-deploy]]. - **Canon gotcha:** the real spec prose lives in `viz/index.html` (grimoire text around line ~950); `GODSTRUMENT_MANUAL_SOURCE.md` claims to be exhaustive but has drifted before (Earth Echo / Schumann layer was missing). When they disagree, **viz/index.html is truth** — update the manual to match, not the other way. - Secrets (Cloudflare token etc.): read from `.env`/local files, never from chat. A CF token was pasted in chat once and rolled — don't repeat that. diff --git a/GODRUM_BRIEF.md b/GODRUM_BRIEF.md new file mode 100644 index 0000000..2b4e5b0 --- /dev/null +++ b/GODRUM_BRIEF.md @@ -0,0 +1,462 @@ +# GODRUM — build brief · Stage 1 + +> **You are an execution agent (Opus).** You have been assigned a lane: **Agent A** (drum engine) or **Agent B** (beat panel + sequencer). Read **Part 0** fully, then execute ONLY your own part. Do not do the other agent's work, even if it looks easy. Your output will be reviewed by the planning model before merge; end your run with the report described in §0.8. + +--- + +## Part 0 — shared context (both agents read this) + +### 0.1 What we're building + +GODRUM: a "make a beat" feature for the Godstrument. Godstrument already has a complete rhythmic backbone — a master clock (`godtime`), a 16-step sequencer with per-step velocity/chance/ratchet/p-lock, swing + humanize with groove presets, Euclidean fills, and an 8-bar arranger — but **no drums**. The only percussion today is one synthesized noise hi-hat. Stage 1 adds: + +- **Agent A:** five synthesized drum voices (kick, snare, clap, closed hat, open hat) inside the `Synth` engine, with a small frozen public API. +- **Agent B:** drum lanes in the step sequencer + a `🥁 beat` panel to program them, plus persistence of the kit. + +Later stages (not yours): integration + kick-ducking (C), GODSONIQ sample-slicing (D), finger-drumming/live record (E), grimoire docs (F). + +### 0.2 The codebase in 60 seconds + +- Everything is **one file**: `viz/index.html` (~8,470 lines, ~600 KB). Lines ~425–1200 are the in-app manual ("grimoire", HTML prose). Line 1213 opens one giant IIFE containing the whole app. Vanilla JS + raw Web Audio, **no libraries**. +- The synth is the `Synth` IIFE at **lines 7794–8180**. All voices sum into `N.preSat` → saturation → post → glitch → bitcrush worklet → `N.out` → limiter → destination, with reverb/delay/chorus/Earth-Echo as parallel sends built in `build()` (7817+). +- The groove clock: `frame()` advances `seqPhase` (line 4066); swing/humanize shift each 16th's onset (4068–4074); on each new step `seqTick()` (line 2413) fires every enabled seq. **Swing is applied at the clock level, so anything fired from `seqTick()` inherits the groove for free.** +- Seqs live in the `seqs` object (line 1488), keyed by destination key, created by `seqFor(key, isNote)` (1556): `{on, steps[16], vel[16], chance[16], rat[16], lock[16]}`. +- Patches serialize via `serializePatch()` (2621) / `loadPatch()` (2634); `seqs` is deep-copied wholesale, and `migrateSeq()` (2560) normalizes each on load — any 16-step seq round-trips, so **drum patterns saved under `seqs` persist with zero extra work**. Kit knob state does need explicit plumbing (Agent B). +- UI: full-screen canvas + DOM overlay panels. Launcher buttons `🎛 tracks` / `🎹 OMNI` are created at lines 2399–2411 (`#arrbtn`, `#omnibtn` — CSS in the `