Skip to content

Plan two reverbs that beat Freeverb: a Dattorro plate and an FDN hall - #142

Merged
ninjudd merged 3 commits into
mainfrom
plan/reverbs
Aug 11, 2026
Merged

ninjudd merged 3 commits into
mainfrom
plan/reverbs

Conversation

@ninjudd

@ninjudd ninjudd commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Freeverb was chunk 1 of realtime's fastest correct port, and it sounds like it: a static tail (no modulation, so sustained material rings the combs metallically), echo density that never grows, and stereo that is one network offset 23 samples. This plans its two successors as new insert effects — plate, Jon Dattorro's 1997 figure-8 tank taken whole (published topology, published tunings scaled from 29 761 Hz the way Freeverb's already scale), and hall, a Jot feedback delay network: eight mutually-prime delay lines under a Householder matrix, whose per-band decay exposes directly what a damping knob euphemizes (decay: 3.5, decay_low: 1.3, decay_high: 0.4 reads like how rooms actually behave). Freeverb stays, deliberately: with no users and only the example project, replacement would be cheap, but a kept reverb is a permanent A/B — same send, three effect names, difference audible in one edit under the live watch — and that comparison was judged worth more than the tidiness of deleting it.

Both effects inherit realtime.md's constraints and the plan says how each is met: causal, deterministic, and block-size invariant (decision 3), analytic tails for the compiler's chain-growth arithmetic (plate: predelay + T60; hall: the longest band governs), and denormal-safe without flushing (decision 6). The interesting one is modulation — the thing Freeverb lacks and the reason plates shimmer — kept golden-clean by construction: LFO phase is a pure function of the absolute sample index, seeded by locate with the position it lands on, so a seek hears exactly what a from-the-top render would, block partitioning cannot move a bit, and modulation: 0 is bit-frozen for the harness. Each chunk bumps RENDER_PLAN_VERSION (a new effect is the listed reason that version exists) and grows the session insert union, with the old daemon's fail-closed parse doing what it is for. Existing songs rebuild as pure cache hits — action keys never move.

Convolution reverb (impulse responses as committed assets — a real place in the repo, hash-pinned like any asset — but needing a cross-platform-deterministic FFT before it can join the golden) and the exotic architectures (velvet-noise, scattering delay networks) were ranked in the same discussion and land as later.md lines, not chunks.

Two chunks, one per effect, plate first: streaming class + whole-buffer wrapper + analytic tail, schema/session/plan arms on both sides, dsp-check block-invariance and subnormal cases, golden byte-identity — and the definition of done is the demo the realtime engine was built for: field play creek --watch with the shared room's insert flipped between reverb, plate, and hall, three rooms A/B'd live, the ear deciding what creek ships with.

Testing

Docs only — nothing builds or runs differently. pnpm test from the repo root stays green (40 files / 608 tests). Read the plan at docs/projects/all/reverbs.md; the claims worth probing: §2.4's determinism argument for modulated delays against realtime.md decision 3's block-invariance requirement (the LFO-phase-from-sample-index construction is the whole answer, so a hole in it sinks chunk 1), §2.5's tail formulas against the compiler's existing chainGrowth reverb arm in src/graph/live.ts, and decision 1's cache claim against the rule that new insert types touch no existing action key. Note this branch shares a docs/projects/now.md edit region with #141 (both add a line to the list); whichever merges second takes a one-line rebase.


Note

Low Risk
Documentation-only changes to project planning files; no runtime, schema, or build behavior changes in this PR.

Overview
Adds docs/projects/all/reverbs.md, a draft plan for two new insert effects—plate (Dattorro figure-8 tank) and hall (Jot FDN with per-band decay)—while keeping existing reverb (Freeverb) for live A/B. The doc locks six decisions: realtime constraints (deterministic modulation via sample-index LFO phase, analytic tail growth beside chainGrowth in src/graph/live.ts, cache law), example YAML, two implementation chunks, and a definition of done centered on field play creek --watch.

docs/projects/now.md adds a line committing the reverbs work. docs/projects/later.md adds deferred lines for convolution IR reverb and exotic architectures, both pointing back to reverbs §1.

Reviewed by Cursor Bugbot for commit ffb6ccc. Configure here.

@minjudd

minjudd commented Aug 11, 2026

Copy link
Copy Markdown

Starting review of ffb6ccc.

@minjudd minjudd left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewing ffb6ccc. The description names three claims to probe and says a hole in the modulation argument sinks chunk 1, so that is where I spent the review. There is a hole, and it is narrow and fixable.

The cache claim is solid, which is the one I most expected to bite. "Each chunk bumps RENDER_PLAN_VERSION" and "action keys never move" only coexist if the plan version is outside the key, and it is: actionKey hashes {rule, rule_version, …} with rule_version: generatorFor(node.spec).version (build.ts:136-148), while RENDER_PLAN_VERSION lives in render-daemon.ts and is written into the plan JSON, never into the key. Adding a session insert arm does not touch an untouched song's spec or its generator's version, so existing songs really do rebuild as pure cache hits.

The tail formulas match the arm they say they live beside, in shape: chainGrowth's reverb case is round(predelay_ms/1000·rate) + round(decay·rate), which is the plan's predelay + decay·rate with the units spelled out. One case is not covered — thread below.

The determinism construction is right in its principle and wrong in its implementation sketch, which are two different sentences in §2.4. "A pure function of the absolute sample index" is exactly the property that makes block-invariance free; "seeded by locate with the position it lands on" names the wrong position, and the engine already carries something better. Thread below.

The constraint inventory in §1 is accurate. Denormal-safety-without-flushing is the real constraint (#137 deleted the flush and the −60 dB truncation argument is what replaced it), the analytic-tail requirement is what chainGrowth and chainWarmup both consume, and "no platform FFTs" is the honest reason convolution goes to later.md rather than a chunk — chainWarmup falls back to a whole second per unrecognised stage, so an unanalyzable tail is not merely awkward, it is uncomputable.

Decision 1 is the interesting judgement and I think it is right. Keeping Freeverb as a permanent A/B costs a schema arm and buys a comparison that the live watch makes into one edit — and the plan is honest that replacement would be cheap today, which is what makes keeping it a choice rather than inertia. The definition of done being a listening decision rather than a metric is the correct shape for this kind of work.

Conventions hold. status: Draft, sections numbered, both later.md lines cite §1 where the ranking actually lives, and the now.md line is a hook rather than a summary. The description already flags that this and #141 both edit now.md and the second one rebases; that is the right call and not something to fix here.

No code moved, so the 608-test claim carries from the merge underneath: git diff --stat 67a431c..ffb6ccc -- . ':!docs' is empty.

Two threads, both on §2 arithmetic rather than on the architectures, which I have no quarrel with.

Comment thread docs/projects/all/reverbs.md Resolved
Comment thread docs/projects/all/reverbs.md Resolved
Freeverb's tail is static, its density never grows, and its stereo is
one network offset 23 samples; it stays anyway, deliberately, as the
permanent A/B under the live watch. The two replacements are the
standard architectures that fix its faults by construction: plate is
Dattorro's 1997 figure-8 tank whole, hall is a Jot FDN whose per-band
decay exposes what damping euphemizes. Both inherit realtime.md's
constraints — causal, deterministic, block-invariant, analytic tails,
denormal-safe without flushing — and modulation stays golden-clean by
deriving LFO phase from the absolute sample index. Convolution and the
exotic architectures are ranked and deferred to later.md.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ffb6ccc7a3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/projects/all/reverbs.md Resolved
Comment thread docs/projects/all/reverbs.md Resolved
Comment thread docs/projects/all/reverbs.md Resolved
@minjudd

minjudd commented Aug 11, 2026

Copy link
Copy Markdown

Inspected c16a71b. It is a pure rebase onto #141's merge (a6b4584), not a response to the review — git diff ffb6ccc..c16a71b -- docs/projects/all/reverbs.md docs/projects/later.md is empty, so the plan is byte-identical to what I reviewed.

The one file that had to move resolved correctly: now.md at this head carries both list entries, Cross-rate live wiring from #141 and Reverbs from this branch, in the right places and with nothing duplicated or dropped. That is the one-line rebase the description predicted, and #141 landing first made it this branch's to take.

Both findings from ffb6ccc therefore stand unchanged, and their threads are still anchored at this head — §2.4's locate seeding naming the position rendering does not resume at, and hall's tail formula governing on decay_low alone. Not re-reviewing the architectures; nothing about them moved.

…axis, the brightest band

Codex caught the Householder description computing mean(x) − x — common
-mode annihilation, not a reflection — now written as y = x − 2·mean(x)
with the factor of two named as what makes it orthogonal. minjudd
caught the LFO seed: locate lands behind its target to warm up, so
seeding the landing position left a permanent phase error the size of
the warmup; the phase axis is now the engine's unwrapped clock, with
the counter initialized to wherever rendering starts, and the two
bounds — state matches within the warmup's −60 dB threshold, loop
passes deliberately do not repeat phase — said plainly. Both reviewers
caught the hall tail governing on decay_low alone; the formula now
takes the longest band whichever it is.
@minjudd

minjudd commented Aug 11, 2026

Copy link
Copy Markdown

Starting review of 839f06f.

@minjudd minjudd left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewing 839f06f. Both findings are fixed the right way, and the round found a third thing I had not: the Householder correction is the most consequential change here. One citation is wrong, which is all that stands between this and an approval.

§2.4 now rests on the axis that already exists. Deriving phase from the unwrapped clock — "the clock renderBlock already maintains and locate already sets, the same axis the limiter's ramps ride" — removes the seed as a thing that can be wrong rather than correcting it, and live.cpp:529's window.rampStart = clock confirms the ramps really do ride it. Initializing the counter at "wherever the chain starts rendering: zero offline and at load, the warmup start at a locate" is the correct position, and it is now named as the position rather than described.

The two bounds are the part that makes it trustworthy. Replacing "a seek matches a from-the-top render exactly" with a −60 dB state bound and exact equality only from the top — where the golden actually compares — is the honest version. And saying outright that pass two under loop does not repeat pass one's phase, because a tail identical every pass is the static-ring disease the plan exists to cure, turns the ambiguity I raised into a stated design position.

The Householder fix is right, and I checked the algebra rather than taking it. H = I − (2/N)·11ᵀ gives Hx = x − (2/N)·1(1ᵀx) = x − 2·mean(x)·1, so the O(N) form is as stated. It is a genuine reflection: eigenvalue −1 on the all-ones direction, +1 on its complement, HᵀH = I, norm preserved. The draft's mean(x) − x is ((1/N)11ᵀ − I)x = −(I − P)x with P the projection onto all-ones, which is singular — it sends the constant vector to zero, so the common mode of the delay lines dies instantly instead of ringing. "Annihilates the common mode and is not lossless" is exactly what it does, and in an FDN that is audible as a missing bloom rather than a subtle error.

§2.5 took the more robust of the two fixes. max(1, decay_low, decay_high) with "the schema constrains neither multiplier, so the formula must not assume the low band wins" stays correct whatever the arms end up allowing, and it keeps "the longest band governs" checkable against the formula beside it.

Everything I verified last round still holds and nothing else moved: the action key does not carry RENDER_PLAN_VERSION, chainGrowth's reverb arm is the shape §2.5 mirrors, and chainWarmup's −60 dB comment at live.cpp:457-459 is the threshold §2.4 now cites. No code moved, so the 608-test claim still carries from the merge underneath.

One thread, on a pointer rather than an argument.

Comment thread docs/projects/all/reverbs.md Resolved
minjudd caught the citation pointing at realtime.md chunk 4 for a bound
that document never carried anywhere — the locate warm-up shipped in
chunk 3's review round and lived only as chainWarmup's comment in
live.cpp. It is now a dated chunk-3 amendment, and the reverbs plan
cites it there.
@minjudd

minjudd commented Aug 11, 2026

Copy link
Copy Markdown

Starting review of d7c0446.

@minjudd minjudd left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving d7c0446. The citation now resolves, and it resolves because the bound got written down rather than because the pointer got redirected — the harder of the two fixes and the one worth having.

The amendment describes the mechanism accurately. "Each reverb's tail, each limiter's window, a second per eq stage" is chainWarmup term for term:

if (stage.reverb != nullptr)   warmup += stage.reverb->tailSamples();
else if (stage.limiter != nullptr) warmup += stage.limiter->latencySamples();
else                            warmup += rate;

The else branch really is one second, the attribution to #139 is right — that is chunk 3's review round, the one that warmed the chain and retired the old session outside the lock — and the 60 dB threshold is live.cpp:457-459's wording carried over intact. It is placed inside chunk 3's list item, so nothing renumbered: ## 7 Chunks still runs 3 at line 260 and 4 at line 275, and every existing citation into that section still lands where it did.

Recording it was the right call on its own merits, independent of my thread. A numerical bound that governs what a seek sounds like, living only in a comment inside the engine, is exactly the kind of thing that gets rediscovered by measurement later — and reverbs.md §2.4 now has something to point at that a reader can follow.

The reverbs.md citation is precise now: naming both the amendment and that it was recorded from chainWarmup's own comment tells a reader where the authority actually lives, which is more useful than either half alone.

One correction to make on the record rather than another round, since it changes nothing technical. The amendment justifies itself with "[reverbs.md] and [cross-rate-live.md] both reason from it" — only reverbs.md does. cross-rate-live.md mentions locate twice, but both times about the delivery converter's lifecycle (decision 3: reset to primed-with-zeros on locate, stop and swap, "the onset after a reset is exactly a stream start's"), which is a different mechanism at a different point in the path — outside the golden, and deliberately reset rather than warmed. If anything the two plans take opposite approaches at locate, so the cross-rate reference is the weaker half of the motivation, not a second citation. The recording stands on reverbs.md alone; "both" is just one word more than the evidence.

Everything else carries over from 839f06f, where I did the work: the Householder correction (H = I − (2/N)·11ᵀ is a genuine reflection; the draft's mean(x) − x is singular and kills the common mode), the phase axis moving to the unwrapped clock that locate already sets and the limiter's ramps already ride, the two bounds stated plainly including the deliberate non-repeat under loop, and max(1, decay_low, decay_high) refusing to assume the low band wins. And from ffb6ccc: RENDER_PLAN_VERSION stays out of the action key, so per-chunk bumps and "action keys never move" genuinely coexist.

No code moved in any round, so the 608-test claim carries from the merge underneath.

No findings.

@ninjudd
ninjudd merged commit eb0db73 into main Aug 11, 2026
1 check passed
@ninjudd
ninjudd deleted the plan/reverbs branch August 11, 2026 11:25
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.

2 participants