-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Fix #303623: Fix multiple issues with chord diagrams in MusicXML export #5958
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
Conversation
There are quite a few MusicXML tests failing, see https://travis-ci.org/github/musescore/MuseScore/jobs/675894505#L4385 ff. |
|
||
for (const Element* e : seg->annotations()) { | ||
int wtrack = -1; // track to write annotation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Despite my best efforts, I still don't understand what are those wtrack
checks are used for. Since I'm not too sure, I did'nt add such a check in the following harmonies
method. Fill free to tell me where I'm wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this might be related to this issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wtrack is the track where something is to be written. Required when MuseScore forces things in a staff's first track (e.g. staff text), when no note start at that time. This seems to no longer apply to harmonies.
importexport/musicxml/exportxml.cpp
Outdated
const Harmony* harmony = diagram->harmony(); | ||
if (harmony) { | ||
exp->harmony(harmony, diagram, offset); | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line break and less indent before else
. Maybe make it an else if
importexport/musicxml/exportxml.cpp
Outdated
const Element* defaultHarmony = harmonies.back(); | ||
exp->harmony(toHarmony(defaultHarmony), diagram, offset); | ||
harmonies.pop_back(); | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line break and less indent before else
importexport/musicxml/exportxml.cpp
Outdated
// That's why we need to explore the remaining segments to find | ||
// `Harmony` and `FretDiagram` elements in Segments without Chords and output them now. | ||
for (auto seg1 = seg->next(); seg1; seg1 = seg1->next()) { | ||
if (!seg1->isChordRestType()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
braces not needed here
@@ -6444,4 +6471,3 @@ void ExportMusicXml::harmony(Harmony const* const h, FretDiagram const* const fd | |||
} | |||
|
|||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unneeded change
@lvinken: mind reviewing this? |
Hi @Jojo-Schmitz, thank you for your review. I fixed the formatting issues you mentioned. |
And now it'd be good if you could squash them all into one commit, and making sure the commit title (not just the PR title) is "Fix #303623: Fix multiple issues with chord diagrams in MusicXML export" |
importexport/musicxml/exportxml.cpp
Outdated
seg, fd); | ||
} | ||
|
||
for (const Element* e: harmonies) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
braces not needed here
0d86401
to
6ff0246
Compare
@Jojo-Schmitz Ok, I just force-pushed the squashed version of the branch. |
Will have a look, but don't know when yet. |
Started reviewing, may take a few days. |
<root-step>F</root-step> | ||
</root> | ||
<kind>major</kind> | ||
<offset>1</offset> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect (which is an existing bug), see https://musescore.org/en/node/304371.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Since this seems to be an existing bug that is not directly linked nor caused by this PR's modifications, how do you want to play this? Should this be corrected and added to the current PR or handled in a different one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as the regression tests don't break, I can live with leaving this unsolved for some time. It does lead to invalid MusicXML, so I would want it fixed for 3.5.
Review done, thanks for implementing this, as it works a lot better than my previous implementation. No further comments. |
@lvinken Thank you for your review. @Jojo-Schmitz, is this good to merge? |
importexport/musicxml/exportxml.cpp
Outdated
if (harmony) { | ||
exp->harmony(harmony, diagram, offset); | ||
} | ||
else if (! harmonies.empty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
picky mode: that space after ! is not needed
Looks good to me too, with one minor exception. |
6ff0246
to
2252102
Compare
@Jojo-Schmitz Hi. I just updated the PR with a fix for your last comment. |
Hi @Jojo-Schmitz. I'm not sure about how the MuseScore project's handles PR merging. This PR has been hanging for a week, should I just be patient or are further actions required from me? |
Patience. There a PRs that are several years old. |
Hi @Jojo-Schmitz, I didn't want to rush you or anything, just make sure that I had done everything I could to get this fixed. I'll wait then :) |
You can't rush me here, I can't merge PRs ;-) |
Oh, seems the name 'testHarmony6' is taken meanwhile (since 870db63), so these would need to get renamed to 'testHarmony7'. |
looking forward for rebase (on 3.x probably), then I'll merge it |
Still looking for rebase |
Archived due to inactivity (we can re-open it later once the author will return) |
@Jojo-Schmitz and @vpereverzev -- To keep this moving along, I've forked this fork, done the rebase onto 3.x, and submitted a new pull request. See here: #7167 |
This seems still to be needed for master |
…icXML export Port/rebase of musescore#5958 Fore some reason that PR's test files (testHarmony6.mscx, testHamony6_ref.xml) were already in master (as testHarmony7.mscx, testHamony76_ref.xml) but not used in the unit tests.
…icXML export Port/rebase of musescore#5958 Fore some reason that PR's test files (testHarmony6.mscx, testHamony6_ref.xml) were already in master (as testHarmony7.mscx, testHamony76_ref.xml) but not used in the unit tests.
…icXML export Port/rebase of musescore#5958 Fore some reason that PR's test files (testHarmony6.mscx, testHamony6_ref.xml) were already in master (as testHarmony7.mscx, testHamony76_ref.xml) but not used in the unit tests.
…icXML export Port/rebase of musescore#5958 Fore some reason that PR's test files (testHarmony6.mscx, testHamony6_ref.xml) were already in master (as testHarmony7.mscx, testHamony76_ref.xml) but not used in the unit tests.
…icXML export Port/rebase of @thibault's musescore#5958 For some reason that PR's test files (testHarmony6.mscx, testHarmony6_ref.xml) were already in master (as testHarmony7.mscx, testHarmony76_ref.xml), but not used in the unit tests.
…icXML export Port/rebase of @thibault's musescore#5958 For some reason that PR's test files (testHarmony6.mscx, testHarmony6_ref.xml) were already in master (as testHarmony7.mscx, testHarmony7_ref.xml), but not used in the unit tests.
…icXML export Port/rebase of @thibault's musescore#5958 For some reason that PR's test files (testHarmony6.mscx, testHarmony6_ref.xml) were already in master (as testHarmony7.mscx, testHarmony7_ref.xml), but not used in the unit tests.
…icXML export Port/rebase of @thibault's musescore#5958 For some reason that PR's test files (testHarmony6.mscx, testHarmony6_ref.xml) were already in master (as testHarmony7.mscx, testHarmony7_ref.xml), but not used in the unit tests.
…icXML export Port/rebase of @thibault's musescore#5958 For some reason that PR's test files (testHarmony6.mscx, testHarmony6_ref.xml) were already in master (as testHarmony7.mscx, testHarmony7_ref.xml), but not used in the unit tests.
…icXML export Port/rebase of @thibault's musescore#5958 For some reason that PR's test files (testHarmony6.mscx, testHarmony6_ref.xml) were already in master (as testHarmony7.mscx, testHarmony7_ref.xml), but not used in the unit tests.
…icXML export Port/rebase of @thibault's musescore#5958 For some reason that PR's test files (testHarmony6.mscx, testHarmony6_ref.xml) were already in master (as testHarmony7.mscx, testHarmony7_ref.xml), but not used in the unit tests.
…icXML export Port/rebase of @thibault's musescore#5958 For some reason that PR's test files (testHarmony6.mscx, testHarmony6_ref.xml) were already in master (as testHarmony7.mscx, testHarmony7_ref.xml), but not used in the unit tests.
…icXML export Port/rebase of @thibault's musescore#5958 For some reason that PR's test files (testHarmony6.mscx, testHarmony6_ref.xml) were already in master (as testHarmony7.mscx, testHarmony7_ref.xml), but not used in the unit tests.
…icXML export Port/rebase of @thibault's musescore#5958 For some reason that PR's test files (testHarmony6.mscx, testHarmony6_ref.xml) were already in master (as testHarmony7.mscx, testHarmony7_ref.xml), but not used in the unit tests.
…icXML export Port/rebase of @thibault's musescore#5958 For some reason that PR's test files (testHarmony6.mscx, testHarmony6_ref.xml) were already in master (as testHarmony7.mscx, testHarmony7_ref.xml), but not used in the unit tests.
…icXML export Port/rebase of @thibault's musescore#5958 For some reason that PR's test files (testHarmony6.mscx, testHarmony6_ref.xml) were already in master (as testHarmony7.mscx, testHarmony7_ref.xml), but not used in the unit tests.
…icXML export Port/rebase of @thibault's musescore#5958 For some reason that PR's test files (testHarmony6.mscx, testHarmony6_ref.xml) were already in master (as testHarmony7.mscx, testHarmony7_ref.xml), but not used in the unit tests.
Resolves: https://musescore.org/en/node/303623
There are multiple issues in the MusicXML annotations export that prevents chord diagrams to be exported in most cases:
This PR rewrites the harmony export algorithm to fix those issues.
This is my first contribution to MuseScore and moreover I'm not familiar with c++ at all, so there will probably be some stuff to fix.