Skip to content

synthio: support running status in MidiTrack - #35

Open
tyeth wants to merge 1 commit into
synthio-miditrack-meta-eventsfrom
synthio-miditrack-running-status
Open

tyeth wants to merge 1 commit into
synthio-miditrack-meta-eventsfrom
synthio-miditrack-running-status

Conversation

@tyeth

@tyeth tyeth commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

A MIDI file may omit the status byte when it repeats the previous one, so a run of notes on the same channel is encoded as data bytes alone. The decoder read each of those as a status byte, took the invalid-event branch and ended the track.

This remembers the last channel status byte and implies it when the next event begins with a data byte. System messages cancel it, as the specification requires.

Verification. Cross-checked against adafruit_midi_parser on a hand-built running-status file: the new decoder reproduces its note timeline exactly, the old one returned nothing. Builds clean on arm and xtensa. No hardware.

Size. About +128 bytes of flash on nrf52840, plus one byte per MidiTrack object.

Stacked on #34 — review that first.

🤖 Generated with Claude Code

A MIDI file may omit the status byte when it repeats the previous one, so
a run of notes on the same channel is encoded as data bytes alone. The
decoder read each of those as a status byte, took the invalid-event branch
and ended the track.

Remember the last channel status byte and imply it when the next event
begins with a data byte. System messages cancel it, as the specification
requires.

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