Skip to content
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

[MU4] fix MU3 issue #323402, accidentals not shown as expected for altered unisons #8772

Merged

Conversation

wizofaus
Copy link
Contributor

@wizofaus wizofaus commented Aug 1, 2021

Resolves: https://musescore.org/en/node/323402

Altered unisons where the same note occurs twice in one chord but with different accidentals need to ensure that the accidentals for both notes are always correctly shown (currently they appear and disappear somewhat randomly)

  • I signed CLA
  • I made sure the code in the PR follows the coding rules
  • I made sure the code compiles on my machine
  • I made sure there are no unnecessary changes in the code
  • I made sure the title of the PR reflects the core meaning of the issue you are solving
  • I made sure the commit message(s) contain a description and answer the question "Why do those changes fix that particular issue?" or "Why are those changes really necessary as improvements?"
  • I made sure the commit message title starts with "fix #424242:" if there is a related issue
  • I created the test (mtest, vtest, script test) to verify the changes I made

@wizofaus wizofaus force-pushed the show_accidentals_altered_unisons branch from 191c64f to 114e79a Compare August 1, 2021 23:48
@@ -2354,6 +2363,10 @@ void Note::updateAccidental(AccidentalState* as)
} else if (acci == AccidentalType::NONE) {
acci = AccidentalType::NATURAL;
}
} else if (chordHasAnotherAccidentalForSameNote(this)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

potentially this condition could be just be added to the if above, but hard to be confident that won't have other consequences

Measure* m = score->firstMeasure();
Chord* c = m->findChord(Fraction(0, 1), 0);
QVERIFY(c->downNote()->accidental() && c->downNote()->accidental()->accidentalType() == Ms::AccidentalType::FLAT);
QVERIFY(c->upNote()->accidental() && c->upNote()->accidental()->accidentalType() == Ms::AccidentalType::NATURAL);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would have preferred to use QCOMPARE however this is crashing for me using MSVC debug C runtime, when it tries to delete the strings returned by QTest::toString( ). No idea why, it all looks fine stepping through it.

@wizofaus wizofaus changed the title [MU4] fix MU3 issue #232402, accidentals not shown as expected for altered unisons [MU4] fix MU3 issue #323402, accidentals not shown as expected for altered unisons Aug 2, 2021
@wizofaus wizofaus force-pushed the show_accidentals_altered_unisons branch from 114e79a to fb2db95 Compare August 2, 2021 01:47
int relLine = absStep(note->tpc(), note->epitch());
return std::find_if(chordNotes.begin(), chordNotes.end(), [note, accVal, relLine](Note* n) {
return n != note && !n->hidden() && absStep(n->tpc(), n->epitch()) == relLine && tpc2alter(n->tpc()) != accVal;
}) != chordNotes.end();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i.e. look for a note on the same A-G step (including octave), but that would require a different accidental.

Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 2, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 3, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 3, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 3, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 7, 2021
@wizofaus
Copy link
Contributor Author

wizofaus commented Aug 9, 2021

Does this need somebody else to review/approve @igorkorsukov

Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 13, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 13, 2021
@igorkorsukov igorkorsukov merged commit 860d690 into musescore:master Aug 16, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 19, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 19, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 30, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 1, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 2, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 9, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 10, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 23, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 26, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 29, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants