Repository navigation
Inserts and the master chain: effects in all three homes - #15
Merged
Merged
Conversation
Chunk 2 of effects.md: the same effect parameters now run as track inserts (applied post-clip-sum - inserts are content, so an insert edit re-renders the stem where a fader move never does) and as the mix master chain, applied after the sum and the master gain so a final limiter's ceiling guards the true output. Insert entries are discriminated on effect: per the recorded obligation, ready for an au: variant. The standalone rules now route through the same applyInsertChain, so one implementation serves all three positions - the reference the live engine will be tested against. Specs omit the inserts/master keys entirely when empty, so every pre-existing stem and mix keeps its action key - no spurious rebuilds on upgrade. 5 new tests: insert DSP on stems, reverb tails growing stems, insert-edit-rebuilds vs fader-still-cached, the master limiter holding its ceiling against +24 dB of drive, and master edits re-running only the sum.
ninjudd
commented
Aug 5, 2026
ninjudd
left a comment
Contributor
Author
There was a problem hiding this comment.
Reviewed at head fd419ee (local checkout matches). Typecheck clean, all 162 tests pass, CI green (test + Bugbot). No findings. Every headline claim reproduced under independent execution.
Executed verification against this head:
- "Zero upgrade cost" confirmed cross-commit — the strongest claim, so it got the worktree treatment: a project with effect-target chains, an insert-less stem, and a chainless mix built under the #14 engine came back fully cached under this head with zero executions. The omit-when-empty spelling (
...(x.length > 0 ? … : {})) genuinely leaves every pre-existing action key byte-identical. - The limiter guards the true output, measured from the CLI — and both sides of the ceiling behave: a −26 dBFS source through
gain_db: 24intomaster: [limit @ −1]measures −2.021 dBFS (below ceiling → untouched, exactly source + gain), and throughgain_db: 30measures −1.000 dBFS (pinned). The corrected post-gain ordering is what makes the second number possible — and the plan-wording fix you caught is now recorded in §5 with the reasoning ("gain drives into the limiter"). - 162/162 with the 157 prior tests untouched, matching the compatibility story.
Verified by reading, no issues found:
- The ordering in both executors matches the recorded design exactly: stem = clips → sum → inserts (pre-fader), mix = stems → faders → sum → master gain → master chain. The limiter-last placement is structural, not conventional.
insert-chain.tsis a faithful unification — I diffed the standalone rules' old bodies against the chain's cases: byte-for-byte the same DSP calls, so #14's rendered artifacts are provably unchanged (the cross-commit cache hit oneq/reverbtargets proves it at the hash level too, since theirversionstayed 1 — correct, because output bytes are identical).- Inserts/master land in parameters, not wiring — so an insert edit re-renders exactly its stem while a fader move still cache-hits (their side-by-side test), and
explainwill show the chain in the hashed parameters. - The
effect:discriminator satisfies the §1 AU-era obligation additively; zod materializes defaults into specs, which means a future schema-default change correctly changes action keys rather than silently serving stale caches. - No new cycle surface: inserts are inline parameters, not references, so #14's cycle detector still covers the entire reference graph.
- A reverb insert growing the stem composes safely downstream — the mix already pads shorter stems to the longest, so the tail ringing past the last clip is just a longer stem.
One small note from the smoke, in the PR's favor: the sub-ceiling case coming out untouched (not just "not clipped") is worth having — it confirms the limiter's leave-quiet-audio-alone property survives the chain plumbing.
This completes the effects phase's definition of done as §4 wrote it. Merging is Justin's checkpoint.
ninjudd
added a commit
that referenced
this pull request
Aug 10, 2026
nested-tracks is Active — chunk 4 is revived by #123 and the soak holds either way; Shipped was the one indefensible value. The three stale prose lines are updated to what actually happened (voice generation through #64/#65 and the #113 fold, effects through #14/#15 with the §6 executor move, musical time through #24), so the keyword and the prose agree on day one. The README claims adoption, not sharing, while agent-config#15 is still open.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Chunk 2 of effects.md §5, closing the phase's definition of done (§4).
What this adds
inserts:— a chain applied post-clip-sum insidetrack-render. Inserts are content: an insert edit re-renders the stem, while a fader move on the same track still cache-hits (tested side by side). A reverb insert grows the stem by its tail — creek's pad now rings past bar 9.master:— applied after the sum and the master gain, so a final limiter's ceiling guards the true output (gain drives into the limiter; the plan's original pre-gain wording was wrong and is fixed). Tested against +24 dB of deliberate drive.effect:— the AU-era obligation from §1, honored in the schema from day one.applyInsertChainas inserts and the master chain;src/audio/insert-chain.tsis the reference implementation the live engine will be tested against.inserts/masterkeys entirely when empty, so every pre-existing stem and mix keeps its action key: upgrading causes zero spurious rebuilds (the existing cache-hit tests prove it — all 157 prior tests pass unchanged).Verified
kit-punchchained offkit-sc), the pad's reverb insert extends its stem 3 s past the last clip, andmix:main's master limiter pins the true peak at exactly −1.00 dBFS — retiring the hand-tuned master gain from the mix-assembly era. One false alarm during verification worth recording: a probe window that read 22 dB low turned out to be the pad's own crossfade valley (release-into-attack), present before the insert — the DSP was right, the probe was mis-aimed.field's matching commit (targets + inserts + master chain + README "Shaping" section) pushes alongside; the phase's definition of done — kit EQ'd, pad reverb'd, mix through a real limiter — is met.
Note
Medium Risk
Touches core render paths (
track-render,mix) and cache keys; behavior is well-tested but wrong insert/master ordering would change audible output and rebuild scope.Overview
Adds track
inserts:and mixmaster:so EQ, limit, and reverb run in the same three places as standalone effect targets: post-clip-sum on stems and after stem sum plus master gain on mixes (so a master limiter actually caps the driven output).applyInsertChaininsrc/audio/insert-chain.tsis the single DSP path; standaloneeq/limit/reverbrules now delegate to one-entry chains instead of duplicating logic.Schemas share effect parameters via
insertSchema(discriminated oneffect:).track-renderandplanMixonly includeinserts/masterin build specs when non-empty, preserving action keys for existing stems and mixes without chains.Docs update the build graph and project model for inserts-as-content vs fader-as-mix-stage caching, and mark effects chunk 1 shipped and chunk 2’s master ordering.
New
inserts.test.tscovers stem re-render on insert edits vs fader-only cache hits, real EQ/reverb DSP, limiter after +24 dB master gain, and mix-only rebuild on master-chain edits.Reviewed by Cursor Bugbot for commit fd419ee. Configure here.