-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Comments
Same issue with Mu3, Not with Mu2 or Mu1 though |
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 |
True. But is is about rounding issue due to musicxml im- and export not yet using |
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 |
The MusicXML importer indeed adds rest to incomplete tuplets. This was suggested long time ago by Nicolas Froment. The algorithm is not smart enough to add a rest at the correct location (immediately before the alto clef, as shown in the fixed file). In the current importer design, enhancing the "adds rest to incomplete tuplets" algorithm seems quite difficult. Removing it would be easy, but the impact of that would have to be investigated. And the 22344 solution is making divisions a multiple of 7 (note: no overflow check has been implemented). |
Notice there are not even any tuplets in the original file, just notes with time modifications to which MuseScore then adds arbitrary tuplet groupings. MusicXML makes this distinction between time modification and tuplets on purpose. The measure is from a real-life composition (Brahms 4th symphony slow movement) and there are no tuplets (i.e., numbers and brackets) in all the editions that I could find. Triplets are implied by the reader because there is a whole run of them, and because of the beam groupings. BTW the file I added with an invisible rest ist just to illustrate. Good to hear that the solution for 22344 is making divisions a multiple of 7, but as I remarked earlier, if there are e.g., 7-tuplets, 13-tuplets, 17-tuplets (or rather such time modifications, to be precise) in the same file (many numbers that are coprime) the calculation of LCM (least common multiple) might overflow and you will still need a solution as I outlined with not all durations being the same. If I remember correctly, earlier versions of MuseScore (up to 2) even did something like that. |
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:
Click Open anyway. Display looks like this:
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:
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
The text was updated successfully, but these errors were encountered: