Skip to content

patcher: SDK 1.35.0 patch builder, patterns as signals, print (lane 4) - #183

Merged
0thernet merged 1 commit into
mainfrom
patch-lane4
Oct 10, 2026
Merged

0thernet merged 1 commit into
mainfrom
patch-lane4

Conversation

@0thernet

Copy link
Copy Markdown
Member

Patcher lane 4 (SDK), per .plans/patcher/design.md "Lane 4" and the networking amendments.

  • core/sdk/v1.ts: patch(name, build, options) / fxPatch, node factories typed from NODE_SPECS, macro(), .to, typed port setters, .plus/.times/.range/.amount, .global(), plain-data overloads (patch({ role, name, nodes, cables }), patch({ ref, macros })). Ids: node type plus 8 base32 chars (newId alphabet) from a stable hash; cables c- plus a hash of their ends.
  • scripts/gen-patch-sdk.ts generates core/sdk/patch-nodes.gen.ts and splices the same block into the vendored single-file SDK; patch-nodes-gen.test.ts fails while stale.
  • Signals sine cosine saw isaw tri square rand perlin irand pat() as a serializable AST with range rangex slow fast segment add mul early late every, Strudel formulas and legacy RNG, seeded per track. track({ mods, lanes }) and signals wired into ports bake to automation.fx points; song({ patches }) holds the library.
  • core/sdk/print.ts prints the plain form, song patches and patch- lanes. SDK_VERSION 1.35.0 (range lane shipped 1.34.0).
  • Docs: DAWG.md "Patches" section, docs/project-format.md SDK entry.

Tests: patch.test.ts (acid example plain data, stable ids, print → eval → reprint byte-for-byte, prettier-stable), signal.test.ts (Strudel's documented formulas at fixed cycles, seeded rand stable and per-track), patch-types.fixture.ts (tsc negative fixture: notes into cutoff, unknown port, unknown setting, unknown wave word), generator freshness. Existing prints: 85 distinct scores from the core/sdk and src/project tests print identically on main and this branch. Local bun run check: 3866 pass, typecheck and format clean.

🤖 Generated with Claude Code

core/sdk/v1.ts: patch(name, build, options) and fxPatch with node
factories typed from NODE_SPECS (generated into core/sdk/patch-nodes.gen.ts
and spliced into v1.ts by scripts/gen-patch-sdk.ts; a test fails while
either copy is stale), macro(), .to, typed port setters,
.plus/.times/.range/.amount, .global(), and the plain-data overloads
patch({ role, name, nodes, cables, ... }) and patch({ ref, macros }).
Node ids are type plus 8 base32 characters (newId's alphabet) from a
stable hash; cable ids are c- plus a hash of their ends.

Strudel signals sine cosine saw isaw tri square rand perlin irand pat()
as a serializable PatternSignal AST with range/rangex/slow/fast/segment/
add/mul/early/late/every, evaluated per cycle with Strudel's formulas and
legacy RNG, seeded per track. track({ mods, lanes }) and signals wired
into ports bake into automation.fx points; song({ patches }) holds the
library. print.ts prints the plain form, song patches and patch- lanes.

Tests: patch.test (acid example, stable ids, print/eval round trip),
signal.test (Strudel formulas at fixed cycles, seeded rand), a tsc
negative fixture, and the generator freshness test. Projects without
patches print byte-identically (85 test scores compared against main).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
dawg Ignored Ignored Preview Oct 10, 2026 8:59pm UTC

Request Review

@0thernet
0thernet enabled auto-merge (squash) October 10, 2026 20:59
@0thernet
0thernet merged commit 972404b into main Oct 10, 2026
14 checks passed
@0thernet
0thernet deleted the patch-lane4 branch October 10, 2026 21:14
0thernet added a commit that referenced this pull request Oct 10, 2026
Lane 4 (#183) landed the SDK builder, so main's four-ways table had
eleven patch rows whose listed SDK gap had opened. Drop PATCH_GAPS and
name each verb's SDK door (patch(), fxPatch(), track.instrument, track.fx,
song.patches; patch mod: pat/irand and the baked automation lane). The
patch mod menu gap stays: the typed verb still refuses until pattern text
has a parser. Its refusal now points at SDK 1.35.0 mods:.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0thernet added a commit that referenced this pull request Oct 10, 2026
* patcher: enforce the SDK door for every patch verb (four-ways)

Lane 4 (#183) landed the SDK builder, so main's four-ways table had
eleven patch rows whose listed SDK gap had opened. Drop PATCH_GAPS and
name each verb's SDK door (patch(), fxPatch(), track.instrument, track.fx,
song.patches; patch mod: pat/irand and the baked automation lane). The
patch mod menu gap stays: the typed verb still refuses until pattern text
has a parser. Its refusal now points at SDK 1.35.0 mods:.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* sdk: regenerate patch node types for engine.vocoder (#184)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@0thernet 0thernet mentioned this pull request Oct 11, 2026
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