Skip to content

Turn one phrase collision into a quantized variant change - #24

Merged
datashaman merged 1 commit into
mainfrom
agent/issue-21-collision-variant
Aug 15, 2026
Merged

datashaman merged 1 commit into
mainfrom
agent/issue-21-collision-variant

Conversation

@datashaman

Copy link
Copy Markdown
Owner

Closes #21.

What changed

  • detect deterministic contact-begin events in the native fixed-step world
  • track per-pair sustained contact and a 500 ms collision cooldown
  • map the first drums–bass contact to an explicit bass variant-change intent
  • author bass variant B and schedule it from the next eligible unscheduled bar
  • keep bass A active while publishing the pending BASS A → B transition
  • apply variant B exactly once at the boundary without rewriting look-ahead MIDI
  • expose selected-pair contact, cooldown, queued intent, and applied-transition diagnostics
  • render pending and applied authoritative variants in PixiJS and accessibility state
  • update stress invariants so intentional mapped bass changes remain distinct from timing regressions on other channels

Impact

Drift now has its first complete spatial-to-musical path: a visible collision produces a predictable audible phrase change while musical timing remains native-owned and quantized.

A collision that occurs after the upcoming bar has already entered the MIDI look-ahead window targets the following bar. This preserves already-scheduled MIDI rather than clearing or rewriting live output.

Validation

  • ./scripts/verify.sh
  • Debug and Release native suites
  • 14 React tests and production TypeScript/Vite build
  • deterministic boundary coverage before, on, and after bar boundaries
  • contact-begin, sustained-overlap, separation, cooldown, and re-contact coverage
  • ten-minute stress run: 51 mapped contacts, one queued/applied transition, 16,806 paired MIDI messages, zero late events, zero phase drift, and zero timestamp error

The Release app was packaged but not launched, preserving the no-focus-stealing test constraint.

@datashaman
datashaman marked this pull request as ready for review August 15, 2026 06:12
@datashaman
datashaman merged commit 056ba64 into main Aug 15, 2026
1 check passed
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.

Turn one phrase collision into a quantized variant change

1 participant