Skip to content

feat: VCV Rack plugin β€” Link Clock, Link Audio Send/Receive/Receive 16 - #516

Open
quasor wants to merge 2 commits into
mainfrom
quasor/vcv-rack-modules
Open

quasor wants to merge 2 commits into
mainfrom
quasor/vcv-rack-modules

Conversation

@quasor

@quasor quasor commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

A VCV Rack 2 plugin (rack/, "Most Distant") that makes Rack a Link Audio citizen. Every module is its own LAN Link (Audio) peer built on plugins/wail_link, the same pattern as WAIL Send / WAIL Receive (ADR-0007). The WAIL app is unchanged.

Module What it does
Link Clock Link timeline β†’ clock / bar reset / run CV. Sample-accurate; optional gate by Link start/stop.
Link Audio Send Publishes a Rack stereo input as a Link Audio channel (engine rate β†’ 48 kHz), stamped at play time. Nameable.
Link Audio Receive Plays one channel (Auto = first WAIL Β· room channel), aligned to its beat stamps.
Link Audio Receive 16 Every WAIL room stream at once: 16 named stereo slots that fill themselves, plus polyphonic L/R outputs.

Design notes (details in rack/README.md, docs/architecture.md, and a new tradeoffs.md entry):

  • Rack renders in bursts and has no host transport. FrameClock maps engine frames to Link Β΅s from block-start observations; stamps, clock edges and playout all use play time.
  • Receive plays room channels exactly on their stamps. For late live LAN channels it grows a max-hold delay instead of skipping (skipping chopped the audio).
  • RoomSlots is a port of WAIL Receive's id-keyed slot manager; RecvSlot is shared playout.
  • Nothing on the audio thread allocates. wail_link gains lb_state_create, lb_capture_into, lb_source_pop_at and lb_state_tempo, plus the start/stop calls Link Clock needs. The CLAP plugins' existing calls are unchanged.

Also included:

  • linkaudio-probe -onsets: click-onset phase vs the beat grid, for checking stamping without a DAW.
  • Packaging spike wail-app/cmd/wailcore: the Go client built as a C static archive and linked into the plugin as one binary, behind a placeholder WAIL module. Groundwork for running the WAIL client inside Rack; there's no session yet.

Test results

  • Unit tests: make test in rack/, 27/27 pass (FrameClock, StampAligner, RoomSlots). go test ./cmd/wailcore passes.
  • Headless Rack end to end (44.1 kHz engine, linkaudio-probe -onsets):
    • Link Clock edges sit βˆ’0.04 ms off the beat (Β±0.01 ms).
    • The tone arrives at the right pitch with no loss.
    • The Send β†’ Receive β†’ Send loop is steady at ~30 ms (Link Audio's LAN delivery jitter), with zero skips.
    • Receive 16 assigns room channels to slots and carries them on the poly outputs.
  • wailcore: two modules share one Go runtime, which starts, ticks and stops cleanly in headless Rack on macOS arm64. A Windows (MinGW) link succeeds but wasn't run. Linux is untested.
  • Repo checks: go test ./... passes, go test -tags linkstub ./... passes, ./scripts/tier2-e2e.sh passes (7 placement checks, 0 failures), and the CLAP plugin ctest passes.

Known gaps

  • Not yet run in the Rack GUI on hardware; kDeviceLatencyUs (5 ms) hasn't been checked against a real device.
  • The Rack plugin isn't built in CI, and Windows/Linux builds are untested.
  • For wailcore, embedding the real engine would compile Link in twice: Go's abllink copy plus wail_link. A test link showed macOS silently resolves the Go side to the plugin's copy. The plugin needs a single Link owner before the engine moves in.

πŸ€– Generated with Claude Code

quasor and others added 2 commits October 6, 2026 21:12
Reports each channel's click onsets against the nearest beat (ms, from the
buffer's begin beat on the probe's own session timeline), so a publisher's
stamping can be checked without a DAW. Used to validate the VCV Rack
modules' clock edges and Send/Receive stamp alignment.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A VCV Rack 2 plugin ("Most Distant", rack/) that makes Rack a Link Audio
citizen. Each module is its own LAN Link (Audio) peer compiled against
plugins/wail_link, like WAIL Send / WAIL Receive (ADR-0007).

- Link Clock: Link timeline β†’ clock / bar reset / run CV, sample-accurate
  (edges measured βˆ’0.04 ms off the beat), optional gate by Link transport.
- Link Audio Send: publishes a Rack stereo input (engine rate β†’ 48 kHz,
  converter delay compensated), stamped at play time; nameable channel.
- Link Audio Receive: plays one channel (Auto = first WAIL room channel),
  aligned to its beat stamps; adaptive max-hold delay for late LAN channels.
- Link Audio Receive 16: every WAIL room stream at once β€” 16 named stereo
  slots that fill themselves (RoomSlots, a port of WAIL Receive's id-keyed
  slot manager) plus polyphonic L/R outputs.

Rack renders in bursts with no host transport, so FrameClock maps engine
frames to Link time from block-start observations; nothing on the audio
thread allocates (new lb_state_create / lb_capture_into / lb_source_pop_at /
lb_state_tempo in wail_link, plus the start/stop calls Link Clock needs).
Pure logic (FrameClock, StampAligner, RoomSlots) has 27 host-compiled unit
tests (`make test`).

Also a packaging spike toward the WAIL client inside Rack:
wail-app/cmd/wailcore built with -buildmode=c-archive and linked into the
plugin as one binary, driven by a placeholder WAIL module. Verified in
headless Rack on macOS arm64; links for Windows (MinGW), unrun; Linux
untested.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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