Bends are out of tune

• Jul 10, 2015 - 15:57
S4 - Minor

Sometimes, bends produces wrong pitches. The issue is more noticeable with short note (in beat) and with fast pitch variation inside the bend . Play attachment and look at bend proprety for more details.

Attachment Size
out of tune pitch bend.mscz 5.29 KB


In reply to by Git Message

Regression No Yes
Reported version 2.1  

Sorry for your effort, but i tested the development build 1d5ae8a and it introduce a new problem instead fixing the old one. In the old problem, pitch bend tend to sound bad when time subdivision increase. Now, bends that was correct before have wrong pitch. For example, a full bend will be played as a halftone bend.

Attachment Size
out of tune pitch bend2.mscz 7.69 KB

In reply to by Yruama_Lairba

Thank you for your feedback, I am aware that this changes the amount of pitch bend, the original issue was that the amount was exactly half of what it should be. I actually used a DAW to test this and ensure the starting and ending pitch was correct.

Thank you also for posting a musescore file for an example, I'll get around to fixing this as soon as possible.

Status active PR created

Fixed by increasing the number of pitch change events, I might need some time to come up with a better solution but so far this should be fixed.

"Bend" already wrong on latest nightlies.
It plays at half the value it should to be. eg: 2 half tones = 1 half tone
like: interval = interval/2
And an extremely out-of-tune (detoned) situation occurs.
And I can't say it was better than before. OK no polite: more bad actually

Edit: and Beta1 too: OS: Windows 10 (10.0), Arch.: x86_64, MuseScore version (64-bit):, revision: 06f0ddd
Edit: and Beta1b too: OS: Windows 10 (10.0), Arch.: x86_64, MuseScore version (64-bit):, revision: 1982daf

I found a perhaps extra bug:

The old code did this:

midiPitch = (pitch * 16384) / 1200 + 8192

This is almost a division-with-rounding. Were it one, it would have looked like this:

midiPitch = (pitch * 16384 + 600) / 1200

Note that the extra is half the divisor, not half the scaling factor, and appended before dividing. I don’t know if that was deliberate.

However, the new code does:

(pitch * 8192) / (PITCH_BEND_SENSITIVITY * 100) + 8192;

Note how the first 16384 was halved but the last 8192 wasn’t. This should perhaps look either like this:

(pitch * 8192) / (PITCH_BEND_SENSITIVITY * 100) + 4096;

Or even like this:

(pitch * 8192 + (PITCH_BEND_SENSITIVITY * 50)) / (PITCH_BEND_SENSITIVITY * 100);

Where are MIDI pitch bends defined? (So we can read which calculation is correct.)

"If nothing has been done, please bring back the old one.
Hearing a little error at the end of the bend is better than hearing the guitar bends is continuously out of tune."