-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pitch-bend range #229
Comments
The |
The problem is to access correct pitch info in Python (as opposed to letting the compiled FluidSynth executable parse a MIDI file, which is probably what pretty_midi does consider pitch bend in the piano roll, but it does that incorrectly in general because at https://github.com/craffel/pretty-midi/blob/main/pretty_midi/instrument.py#L150 it doesn't provide a second input argument to Same during the other usage of So yeah, it would be cool to keep track of pitch-bend range messages. |
Yes, PRs are welcome. |
So I looked into this, and it seems that And then |
It's just to make writing more predictable and testable, it doesn't follow and MIDI spec. |
In MIDI, the pitch-bend range is
2
by default, but can be modified via specific RPN messages, usually followed by specific "Data Entry" messages.It would be nice to have functionality that understands those messages and can report the correct pitch or pitch-bend range.
As far as I understand, the pitch-bend range is set by three to four consecutive MIDI control messages. In hexadecimal, they look like this (with variables shown in bold):
B06500
B06400
B00602
B02604
The "0" after the "B" is the MIDI channel for which the pitch-bend range is being set.
The "02" in the end of the third message is the number of semitones by which the pitch can bend.
The "04" in the end of the fourth message is the number of cents to be added to the semitones.
The last message is optional, i.e. if there is no message of the form /B.26../ (like "B02604" in the example) then the number of cents is zero.
The text was updated successfully, but these errors were encountered: