Skip to content

keyboard: keep the computed note inside the MIDI range - #261

Merged
jcelerier merged 1 commit into
masterfrom
bugfix-round4
Sep 22, 2026
Merged

jcelerier merged 1 commit into
masterfrom
bugfix-round4

Conversation

@jcelerier

Copy link
Copy Markdown
Member

The octave is clamped to 0..127 while note_on takes a uint8_t, so from the default octave seven presses of OCTAVE_PLUS produce notes above 127, which truncate on the way out. Downstream that indexed a 128-entry table and aborted.

Nine is the highest octave the default map fits inside the range; the note is checked too, since the scancode map is the caller's to replace.

For ossia/score#2298.

The octave was clamped to 0..127 while note_on takes a uint8_t, so from the
default octave seven presses of OCTAVE_PLUS produced notes above 127, which
truncated on the way out. Nine is the highest octave the default map fits
inside the range; the note is checked as well, since the scancode map is the
caller's to replace.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PWVTQ1pm3X2Uz7goFgULtC
@jcelerier
jcelerier merged commit b9f19f7 into master Sep 22, 2026
39 of 90 checks passed
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