Repository navigation
fix(notes): keep note-on pitch and velocity in the MIDI range - #451
Open
shauneccles wants to merge 1 commit into
Open
shauneccles wants to merge 1 commit into
shauneccles wants to merge 1 commit into
Conversation
) aubio_notes_do emitted the detected pitch as is (above 127 for anything over about 12.5kHz) and a velocity of 127 + floor(level), which goes to zero or below once the silence threshold is under -126dB: a 440Hz tone at 1e-7 with set_silence(-200) produced velocity -16. Both note-on paths now clamp pitch to 0..127 and velocity to 1..127 (a velocity of 0 is a note-off in MIDI). 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.
aubio_notes_do emitted the detected pitch as is (above 127 for anything
over about 12.5kHz) and a velocity of 127 + floor(level), which goes to
zero or below once the silence threshold is under -126dB: a 440Hz tone
at 1e-7 with set_silence(-200) produced velocity -16. Both note-on paths
now clamp pitch to 0..127 and velocity to 1..127 (a velocity of 0 is a
note-off in MIDI).
Closes #357.
Split out of #432. Checked together with the other small fixes on top of master plus #447:
meson test52/52 ok, andpytest python/testson the setup.py build 600 passed, 51 skipped.🤖 Generated with Claude Code