feat(dsl,pattern,cli): Phase 9 — Arp, humanize, drift, keepFor#21
Merged
Conversation
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 barsArp(props)— arpeggiatorInstrumentDescriptor; cycles through anotes[]array withup/down/pingpong/randommodes, wired into engine step sequencerdrift(center, sigma, theta)— OU-process note pitch wandering; all steps in the same bar share the same offset, mean-reverting toward centerkeepFor(bars, pattern)— freezes pattern bar-evaluation for N bars; useful in live coding to hold a random/varying pattern steady before it rerollsNo conflicts with PR #20
Only touches
@score/dsl,@score/pattern, andcli/engine.ts— does not modifypackages/cli/src/index.ts, so no conflict with theplaylistcommand in PR #20. Theindex.tsmerge 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, wrapArp— 7 tests: descriptor type, props storage, mode/wave/gain, unique ids, no-op lifecycle, envelopedrift— 6 tests: returns function, returns valid note string, sigma=0 identity, same bar same value, varies across bars, independent instanceskeepFor— 5 tests: freezes within block, advances after N bars, array patterns, step wrapping, bars=1🤖 Generated with Claude Code