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

Fix #313105: "No chord" MusicXML import #6888

Merged
merged 1 commit into from
Dec 30, 2020
Merged

Fix #313105: "No chord" MusicXML import #6888

merged 1 commit into from
Dec 30, 2020

Conversation

infojunkie
Copy link

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

This fix imports a MusicXML harmony element with kind=none to signify a "no chord" (invalid root) on the MuseScore sheet as per forum discussion.

  • 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

@infojunkie infojunkie changed the base branch from master to 3.x November 17, 2020 20:22
@infojunkie infojunkie changed the title 313105 no chord import Fix #313105: "No chord" MusicXML import Nov 17, 2020
if (ee.hasAttribute("text")) {
QString rtext = ee.attribute("text");
if (rtext == "") {
if (_e.attributes().hasAttribute("text")) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose this means if the kind tag appears before the root-step tag, and there is no "none" on the root-step, we end up setting the root tpc after all. That's probably a reasonable interpretation of a somewhat ambiguous spec anyhow.

Copy link
Author

Choose a reason for hiding this comment

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

Thinking more about it, I would have preferred to only rely on kind=="none" to signal an invalid root, since that much is clear. Happy to play it however you see fit though.

Copy link
Author

Choose a reason for hiding this comment

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

Anything more to do here on my side?

Copy link
Contributor

Choose a reason for hiding this comment

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

Kind before root-step would not be a valid MusicXML file, the schema does not allow that.
The root-step element is a child of the root element, which must be before the kind element.

@Jojo-Schmitz
Copy link
Contributor

@lvinken Mind to have a look?

@lvinken
Copy link
Contributor

lvinken commented Dec 5, 2020

Will have a look.

@lvinken
Copy link
Contributor

lvinken commented Dec 7, 2020

Checked, looks fine to me.

@vpereverzev vpereverzev merged commit 133fc82 into musescore:3.x Dec 30, 2020
igorkorsukov added a commit to igorkorsukov/MuseScore that referenced this pull request Feb 17, 2021
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.

None yet

5 participants