Skip to content

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

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
Owner

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.

This reads the velocity that was already being parsed and discarded, and releases the note when it is zero.

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

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

Stacked on #35.

🤖 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>
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