Skip to content

Signal routing: define a synth's wiring and work out its live path, with Model D's (t-141) - #113

Merged
JohnD-EE merged 3 commits into
mainfrom
feature/t141-routing
Oct 29, 2026
Merged

JohnD-EE merged 3 commits into
mainfrom
feature/t141-routing

Conversation

@JohnD-EE

Copy link
Copy Markdown
Contributor

What

The data and logic behind the routing view (the view itself is a later task — nothing in app/ or components/ uses this yet).

  • SynthRouting (lib/app/synths/contract.ts): a synth's blocks, the edges between them (with the switches, levels and normals that decide when each carries signal), and which block each jack belongs to. Kept beside the definition in lib/app/synths/routing/<id>.ts, registered in SYNTH_ROUTINGS.
  • Model D's routing (routing/model-d.ts), projected by hand from its spec; the mod bus's crossfade and depth follow toEngine(), so edges go dark at the engine's floor.
  • routingState() (lib/routing.ts): which blocks, edges and cables the current patch uses. Pure. A block marked passes (a mixer, the mod bus) is live only while something live feeds it — so the mod bus and its lines out go dark when MOD MIX leaves both sources under the floor, and the mixer does with every channel off.
  • routingProblems(): holds each routing to its definition and spec; a test runs it over every registered routing.
  • Docs: "Signal routing" in .context/app/synths.md, and a step in the new-synth recipe.

Testing

  • tests/unit/lib/app/synths/lib/routing.test.ts and tests/unit/lib/app/synths/routing.test.ts — 35 passing.
  • ESLint and Prettier clean on the changed files; no type errors in them.

🤖 Generated with Claude Code

JohnD-EE and others added 3 commits October 29, 2026 13:34
…l D's (t-141)

Routing types in the contract, a pure routingState() that lights the path
the patch takes, routingProblems() to hold a routing to its definition,
and Model D's routing projected by hand from its spec.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A block was live whenever a live path ran from it to the output, whatever
reached it, so Model D's mod bus and its lines to the filter stayed lit when
MOD MIX left both sources under the engine's floor, and the mixer stayed lit
with every channel off. A block marked `passes` (it makes no signal of its own)
is now live only while a live edge or cable from a block with signal feeds it,
and routingProblems refuses one that nothing could feed.

Also shares WHEEL and the show/when condition test from patch.ts, reads cable
jack ids through a null-prototype map, and covers the validation's remaining
refusals.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JohnD-EE
JohnD-EE merged commit 071b128 into main Oct 29, 2026
19 checks passed
@JohnD-EE
JohnD-EE deleted the feature/t141-routing branch October 29, 2026 15:39
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