Skip to content

feat(dsl,pattern,cli): Phase 9 — Arp, humanize, drift, keepFor#21

Merged
bwyard merged 1 commit intodevfrom
feature/phase-9-completion
Mar 21, 2026
Merged

feat(dsl,pattern,cli): Phase 9 — Arp, humanize, drift, keepFor#21
bwyard merged 1 commit intodevfrom
feature/phase-9-completion

Conversation

@bwyard
Copy link
Copy Markdown
Owner

@bwyard bwyard commented Mar 21, 2026

Summary

  • humanize(amount, pattern) — deterministic velocity variation per step; same step+bar always produces the same jitter, so patterns stay consistent within a bar but vary across bars
  • Arp(props) — arpeggiator InstrumentDescriptor; cycles through a notes[] array with up/down/pingpong/random modes, wired into engine step sequencer
  • drift(center, sigma, theta) — OU-process note pitch wandering; all steps in the same bar share the same offset, mean-reverting toward center
  • keepFor(bars, pattern) — freezes pattern bar-evaluation for N bars; useful in live coding to hold a random/varying pattern steady before it rerolls

No conflicts with PR #20

Only touches @score/dsl, @score/pattern, and cli/engine.ts — does not modify packages/cli/src/index.ts, so no conflict with the playlist command in PR #20. The index.ts merge conflict (repl + playlist) will be resolved at rebase time after #20 merges.

Test plan

  • humanize — 6 tests: zero preservation, non-zero variation, amount=0 identity, determinism, variance, wrap
  • Arp — 7 tests: descriptor type, props storage, mode/wave/gain, unique ids, no-op lifecycle, envelope
  • drift — 6 tests: returns function, returns valid note string, sigma=0 identity, same bar same value, varies across bars, independent instances
  • keepFor — 5 tests: freezes within block, advances after N bars, array patterns, step wrapping, bars=1
  • All existing instruments still pass (regression check)
  • 1133 total tests passing

🤖 Generated with Claude Code

- pattern: humanize(amount, pattern) — deterministic velocity variation
- dsl: Arp() instrument — arpeggiator factory with up/down/pingpong/random modes
- dsl: ArpDSLProps type — notes, mode, rate, wave, envelope, gain, effects
- dsl: drift(center, sigma, theta) — OU-process note pitch wandering
- dsl: keepFor(bars, pattern) — freeze pattern evaluation for N bars
- cli/engine: wire 'arp' instrumentType into createScoreEngine step sequencer
- tests: humanize (6), Arp (7), drift (6), keepFor (5) — 24 new tests, 1133 total

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bwyard bwyard merged commit f4aa86e into dev Mar 21, 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.

1 participant