8000 audio: keep held keys per track, and follow tracks as they renumber by mparrett · Pull Request #50 · nooga/slab · GitHub
[go: up one dir, main page]

Skip to content

audio: keep held keys per track, and follow tracks as they renumber - #50

Open
mparrett wants to merge 1 commit into
nooga:masterfrom
mparrett:engine-per-track-keys
Open

mparrett wants to merge 1 commit into
nooga:masterfrom
mparrett:engine-per-track-keys

Conversation

@mparrett
Copy link
Copy Markdown
Contributor

The engine kept the editor's held keys for one track at a time (aud_held, aud_track). Each track now keeps its own (Track.keys_held), and they follow the track when tracks are renumbered.

Two bugs this fixes on master today:

  • A key held while tracks renumber sticks. Moving, deleting, grouping, duplicating or inserting a track (a bounce) above the track holding a key sent the release to the old index, and the note sounded until panic. All four paths that renumber tracks now call tracksRenumbered with their old-to-new map. It remaps the engine's queued key events and the keys main holds.
  • A long-held key lost its tail. Stopped, with the graph ringing, the never-quiet limit (RING_MAX_S) counted from the stop. A key held past it was cut the moment it let go. The limit now counts from the last release.

Stopped with keys on several tracks, audition renders the whole graph, as it already does for a track feeding a bus.

No input plays two tracks at once yet. This is the engine side any such routing needs, whatever MIDI protocol sits in front of it. The source routing that follows builds on it.

Testing. zig build test passes. New tests cover keys on two tracks at once, a release queued before tracks renumber, a track deleted or inserted above the held one, and a release tail after a hold past the ring limit. The headless bench (--all --check --no-sheets) is bit-exact on every golden.

🤖 Generated with Claude Code

The engine held the editor's keys for one track at a time (aud_held,
aud_track), so a key for a second track released the first, and a key held
while tracks were moved, deleted, grouped, duplicated or inserted above it
released at its old index and stuck. Each track now keeps its own keys
(Track.keys_held), and every edit that renumbers tracks remaps them through
tracksRenumbered, along with the engine's queued key events.

Stopped with keys on several tracks, audition renders the whole graph, and
the never-quiet ring limit counts from the last release, so a key held past
RING_MAX_S keeps its tail.

No input plays two tracks at once yet; this is the engine side any such
routing needs, whatever the protocol.

Co-Authored-By: Claude Opus 5.5 <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

0