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

MuseScore adds nonexistent rests when importing XML and then thinks it's a corrupt file #22857

Open
ChrisAm1224 opened this issue May 16, 2024 · 5 comments
Assignees
Labels

Comments

@ChrisAm1224
Copy link

ChrisAm1224 commented May 16, 2024

Issue type

Opening/saving issue

Bug description

No response

Steps to reproduce

Open "Brahms 4th Symphony, Andante Moderato Viola m 86 issue with MuseScore.SHY.xml" in
MuseScore issues.zip
This alert appears:
image
Click Open anyway. Display looks like this:
image
MuseScore has added a rest in the end and some tuplets, both of which are not in the original XML, which is supposed to look like this:
image
In order to avoid the curruption message, you can open "Brahms 4th Symphony, Andante Moderato Viola m 86 issue with MuseScore fixed.SHY.xml" which contains an additional invisible rest, but why is this necessary? And why are tuplets being added that are not in the original XML?

Screenshots/Screen recordings

No response

MuseScore Version

OS: Windows 10 Version 2009 or later, Arch.: x86_64, MuseScore Studio version (64-bit): 4.3.0-241231433, revision: github-musescore-musescore-5f36e74

Regression

No.

Operating system

Windows 11

Additional context

No response

@Jojo-Schmitz
Copy link
Contributor

Same issue with Mu3, Not with Mu2 or Mu1 though

@Jojo-Schmitz
Copy link
Contributor

Might be related to (the root cause of) #22344

@ChrisAm1224
Copy link
Author

Might be related to (the root cause of) #22344

not sure though, since 22344 seems to be about export, but this problem is about import

@Jojo-Schmitz
Copy link
Contributor

Jojo-Schmitz commented May 16, 2024

True. But is is about rounding issue due to musicxml im- and export not yet using Fraction, something that got introduced with Mu3, pretty much the last thing before release

@ChrisAm1224
Copy link
Author

ChrisAm1224 commented May 16, 2024

In the example in this bug (Brahms 4th Symphony, Andante Moderato Viola m 86 issue with MuseScore.SHY.xml), divisions is 24 (i.e., the duration of a quarter note). The file consists of all sixteenth triplets, i.e., duration = 4, (one sixth of a quarter note), no rounding error happening here. The issue seems to be that because of the time modification, MuseScore seems to recognize (correctly) that the notes are triplets. It then tries to group them in groups of three (adding the tuplets that are not there either). In the file, after the alto clef (and the backup tag) there are only two notes in a group (beam), and then another three. MuseScore assumes (incorrectly) that all groups must consist of three notes and then in order to force that, just adds a rest in the end (or that's the best explanation that I can come up with; I haven't checked any source code).

In 22344 what I see is divisions = 160, and 7 septuplet notes with duration 23 each, and 7 * 23 = 161, which could qualify as a "rounding error". There are two ways to fix that
(1) make divisions a multiple of 7
(2) if that overflows (because least common multiple might be too large), make one of the notes (in the middle somewhere) duration 22 so the sum is 160. I've seen other software do this.
I see that 22344 has already been solved, I'm curious what the solution will be there.

@avvvvve avvvvve changed the title MuseScore adds non-existent rests when importing XML and then thinks it's a currupt file MuseScore adds nonexistent rests when importing XML and then thinks it's a corrupt file May 17, 2024
@bkunda bkunda added this to To do in 4.x SHORTLIST via automation May 17, 2024
@bkunda bkunda added P2 Priority: Medium engraving labels May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: One of the next releases
4.x SHORTLIST
  
To do
Development

No branches or pull requests

5 participants