Repository navigation
Conversation
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>
Right-click a track's R, then MIDI in, and pick a connected device by name: its notes, on any channel, play the track whether or not it is selected, and REC records them into the track's own clip in the same pass. Sources no track listens to play the selected track, so the default, When selected, changes nothing. The setting is saved by device name (docs/19 midi_in). A source not connected is kept, listed as not connected, and plays when it returns. Live state is per source and channel, so the sustain pedal and all-notes-off act on their own channel. A rescan moves each source's state to its new index by name, and only a departed source's notes let go. poll drains the ring before rescanning, so queued messages keep the index they were sent under. This routes by source rather than by MIDI 1.0 channel number; a program that publishes a source per part (undertone -midi-split) plays several tracks at once. 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.
Stacked on #50. This branch contains #50's commit; review the top commit only (
midi: a track can listen to one MIDI source).A track can now listen to one MIDI source. Right-click its R → MIDI in → When selected (the default, today's behaviour) or a connected device by name.
"midi_in": "…"(docs/19). A source not connected is kept, listed as not connected, and plays again when it's plugged in. MIDI-learn and the knob map are unchanged.This replaces #48, which routed by MIDI 1.0 channel number (1–16). Routing by source doesn't tie tracks to channel numbers, doesn't fight MPE (which spends a channel per note), and is the same for hardware and software. A program that sends several parts publishes a source per part: undertone's
-midi-live -midi-splitpublishesundertone drone,undertone lead,undertone drumsand so on, one track each.Live state is per source and channel, so the sustain pedal (CC64) and all-notes-off (CC120/123) act on their own channel, per the MIDI spec. Before, a pedal on channel 1 also held channel-10 notes. When devices come or go, each source's state follows it to its new index by name, and only a departed source's notes let go.
pollnow drains the ring before rescanning, so a queued message keeps the source index it was sent under. That overlaps #49, which releases everything when any source goes. With both in, this per-source release would take the place of #49's, keeping its unique-ID check for a source replaced under the same name.Up to 16 sources are kept apart; more still play, sharing the last one's state.
Testing.
zig build testpasses, with new tests for per-source and per-channel state, a rescan that moves sources and one that removes one, routing two sources to two tracks, a pitch held from a source and the computer keyboard at once, a track moved under held notes, and the project round-trip ofmidi_in.🤖 Generated with Claude Code