Skip to content

Commit

Permalink
Merge pull request #20240 from mike-spa/allowUpDownOnEndingFretOfBend
Browse files Browse the repository at this point in the history
Allow up-down edit on the ending note of bend in TAB staves
  • Loading branch information
RomanPudashkin committed Dec 4, 2023
2 parents a1a9beb + c807f87 commit 1e32a1e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/engraving/dom/cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1847,6 +1847,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 @@ -1883,7 +1884,7 @@ void Score::upDown(bool up, UpDownMode mode)
return; // no next string to move to
}
string = stt->visualStringToPhys(string);
fret = stringData->fret(pitch, string, staff);
fret = stringData->fret(pitch + pitchOffset, string, staff);
if (fret == -1) { // can't have that note on that string
return;
}
Expand All @@ -1910,7 +1911,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)) {
if (newPitch + pitchOffset != stringData->getPitch(string, fret, staff) && !oNote->bendBack()) {
// oh-oh: something went very wrong!
LOGD("upDown tab in-string: pitch mismatch");
return;
Expand Down

0 comments on commit 1e32a1e

Please sign in to comment.