Repository navigation
No stuck notes: note ledger, arp hand-over, stop and audition - #42
Merged
Merged
Conversation
Notes hung when a clip was edited while it played (a clip note's id was its snapshot index, so an edit orphaned its note-off), when the arp came in or went out mid-note (the notes' offs stopped at the arp), when a key was held through a stop (it started twice), when the editor moved to another track while a key sounded (that track never heard the note-off), and in a rack lane holding two keys (released by id -1, not pitch). - note_ledger.zig: each track's sounding clip notes with ids that don't change. Every block finds them in the snapshot again: an edited note ends at once, the rest where they end; a jump ends what chase doesn't keep. Expression runs to a note's end on its id (docs/07). - engine: takeOver/handBack around the arp, its switch read once a block; Arp.runAs ends the arp's notes on a jump (docs/45). - Stop no longer starts held keys again. A stopped audition rings until quiet (it was cut after 3 s), through the whole graph when the track feeds a bus or another track must hear a note-off. A ring that never falls quiet fades at 30 s and starts clean (docs/31). - Rack lanes match id-less notes by source pitch; held-note requests the engine's queue refused are sent again the next frame. The 16 tracked songs render bit-identical at 32-bit float; the note path per block is 5-30% faster (dense, 64 held, sparse tracks). Co-Authored-By: Claude Opus 5.5 <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.
Notes could hang in any instrument (seen on Mog Passenger), sometimes after a clip ended and sometimes after stop, and a stopped audition cut off about 3 s after release. Five causes were reproduced, and each now has a test:
src/note_ledger.zig), with ids that don't change. Every block it finds them in the snapshot again: a note that only moved in the list plays on, and one that was deleted, retuned, moved or shortened behind the playhead ends at once (docs/07).takeOver/handBackmove sounding notes between the instrument and the arp, which reads its switch once per block. A seek or loop ends the arp's notes, which before could hang until their old position came round again (docs/45).Performance
--bits 32f --no-dither --threads 1, sha256).notesNearscan.Test plan
zig build test: 586/586holdNotesretry tests🤖 Generated with Claude Code