Skip to content

synthio: treat a Note On of velocity 0 as a Note Off in MidiTrack - #11660

Open
tyeth wants to merge 1 commit into
synthio-miditrack-running-statusfrom
synthio-miditrack-note-off-velocity
Open

tyeth wants to merge 1 commit into
synthio-miditrack-running-statusfrom
synthio-miditrack-note-off-velocity

Conversation

@tyeth

@tyeth tyeth commented Oct 23, 2026

Copy link
Copy Markdown
Member

Third of five stacked PRs; targets the branch of the previous one.

The MIDI specification lets a Note On with a velocity of zero stand in for a Note Off, and files commonly use it so a run of notes can share one status byte. MidiTrack ignored velocity entirely, so such a note was started and never stopped, and the voice sounded until the track ended.

Read the velocity that was already being parsed and discarded, and release the note when it is zero.

Verification

Covered by the same cross-check against adafruit_midi_parser. Builds clean on arm and xtensa.

Size

No measurable change — folding the velocity out-parameter into a packed return paid for the added logic.

🤖 Generated with Claude Code

The MIDI specification lets a Note On with a velocity of zero stand in for
a Note Off, and files commonly use it so that a run of notes can share one
status byte. MidiTrack ignored velocity entirely, so such a note was
started and never stopped, and the voice sounded until the track ended.

Read the velocity that was already being parsed and discarded, and release
the note when it is zero.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tyeth
tyeth added this pull request to stack #11668 October 23, 2026 22:57
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