Skip to content

Commit

Permalink
fix #274028: Courtesy accidental on tied note ignored later in measure
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmcclinch committed Jul 8, 2018
1 parent d95727b commit 0bce043
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions libmscore/cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1648,6 +1648,8 @@ void Score::changeAccidental(Note* note, AccidentalType accidental)
if (forceRemove) {
if (a)
lns->undoRemoveElement(a);
if (ln->tieBack())
continue;
}
else if (forceAdd) {
if (a)
Expand Down
8 changes: 4 additions & 4 deletions libmscore/measure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ AccidentalVal Measure::findAccidental(Note* note) const
Chord* chord = toChord(e);
for (Chord* chord1 : chord->graceNotes()) {
for (Note* note1 : chord1->notes()) {
if (note1->tieBack())
if (note1->tieBack() && note1->accidental() == 0)
continue;
//
// compute accidental
Expand All @@ -362,7 +362,7 @@ AccidentalVal Measure::findAccidental(Note* note) const
}
}
for (Note* note1 : chord->notes()) {
if (note1->tieBack())
if (note1->tieBack() && note1->accidental() == 0)
continue;
//
// compute accidental
Expand Down Expand Up @@ -409,7 +409,7 @@ AccidentalVal Measure::findAccidental(Segment* s, int staffIdx, int line, bool &
Chord* chord = toChord(e);
for (Chord* chord1 : chord->graceNotes()) {
for (Note* note : chord1->notes()) {
if (note->tieBack())
if (note->tieBack() && note->accidental() == 0)
continue;
int tpc = note->tpc();
int l = absStep(tpc, note->epitch());
Expand All @@ -418,7 +418,7 @@ AccidentalVal Measure::findAccidental(Segment* s, int staffIdx, int line, bool &
}

for (Note* note : chord->notes()) {
if (note->tieBack())
if (note->tieBack() && note->accidental() == 0)
continue;
int tpc = note->tpc();
int l = absStep(tpc, note->epitch());
Expand Down
4 changes: 2 additions & 2 deletions libmscore/note.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2137,7 +2137,7 @@ void Note::updateAccidental(AccidentalState* as)
return;
}
if ((accVal != relLineAccVal) || hidden() || as->tieContext(relLine)) {
as->setAccidentalVal(relLine, accVal, _tieBack != 0);
as->setAccidentalVal(relLine, accVal, _tieBack != 0 && _accidental == 0);
acci = Accidental::value2subtype(accVal);
// if previous tied note has same tpc, don't show accidental
if (_tieBack && _tieBack->startNote()->tpc1() == tpc1())
Expand Down Expand Up @@ -2186,7 +2186,7 @@ void Note::updateAccidental(AccidentalState* as)
// ultimetely, they should probably get their own state
// for now, at least change state to natural, so subsequent notes playback as might be expected
// this is an incompatible change, but better to break it for 2.0 than wait until later
as->setAccidentalVal(relLine, AccidentalVal::NATURAL, _tieBack != 0);
as->setAccidentalVal(relLine, AccidentalVal::NATURAL, _tieBack != 0 && _accidental == 0);
}

updateRelLine(relLine, true);
Expand Down

0 comments on commit 0bce043

Please sign in to comment.