Skip to content

Commit

Permalink
Allow up-down edit on the ending note of bend in TAB staves
Browse files Browse the repository at this point in the history
Backport of 20240
  • Loading branch information
RomanPudashkin authored and Jojo-Schmitz committed Sep 9, 2024
1 parent e98f267 commit c6805ba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libmscore/cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1566,6 +1566,7 @@ void Score::upDown(bool up, UpDownMode mode)
int tpc1 = oNote->tpc1();
int tpc2 = oNote->tpc2();
int pitch = oNote->pitch();
int pitchOffset = staff->pitchOffset(tick);
int newTpc1 = tpc1; // default to unchanged
int newTpc2 = tpc2; // default to unchanged
int newPitch = pitch; // default to unchanged
Expand Down Expand Up @@ -1600,7 +1601,7 @@ void Score::upDown(bool up, UpDownMode mode)
if (string < 0 || string >= stringData->strings())
return; // no next string to move to
string = stt->visualStringToPhys(string);
fret = stringData->fret(pitch, string, staff, tick);
fret = stringData->fret(pitch + pitchOffset, string, staff, tick);
if (fret == -1) // can't have that note on that string
return;
// newPitch and newTpc remain unchanged
Expand All @@ -1626,7 +1627,7 @@ void Score::upDown(bool up, UpDownMode mode)
}
// update pitch and tpc's and check it matches stringData
upDownChromatic(up, pitch, oNote, key, tpc1, tpc2, newPitch, newTpc1, newTpc2);
if (newPitch != stringData->getPitch(string, fret, staff, tick) ) {
if (newPitch + pitchOffset != stringData->getPitch(string, fret, staff, tick)) {
// oh-oh: something went very wrong!
qDebug("upDown tab in-string: pitch mismatch");
return;
Expand Down

0 comments on commit c6805ba

Please sign in to comment.