musescore / musescore/MuseScore
Problems Reading a MusicXML file
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 15.1k
- Forks
- 3.3k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 91
Description
Describe the bug
Several problems with interacting with MusicXML files using nightly build (.
- Instruments such as "Trumpet in B♭" are not handled correctly. Examining the XML, the instrument name shows as "Trumpet". However, when MU reads back the XML, "Trumpet" is not defined as an instrument and is not mapped to "Trumpet in B♭". Since the XML file appears to use 1-byte ASCII, the flat cannot be written to the file. Though a simple solution appears to be to mapping "Trumpet" to "Trumpet in B♭", this won't work. Since MU supports seven different Trumpets (different transpositions), the best solution is to map the flat to "b" on writing, and map the "b" back to a flat on reading. This also applies for many other instrument names that only differ in the transposition. This may duplicate #16135 but is more explicit.
- Voltas are mishandled on input. Apparently, voltas have to be individually applied to each staff in the XML. When reading the XML, the process needs to be reversed, only displaying the volta on the first staff. To the best of my knowledge, MU does not support any way of having a volta apply to a subset of the staves. MU doesn't even support different dynamics for different passes through a repeated passage or instructions such as "first time only" which, I believe, would be easier to implement.
- Glissando cause problems. In the original score, measures 46, 48, and 50 in staves 1-5 have two voices populated. Voice 1 is visible but not played. Voice 2 is played but not visible. Voice 1 has a dotted half gliss'ing to an eighth while voice two has a half tied to two eights with the gliss starting from the last eighth to the same final eighth as the first voice. The text is disabled in all measures for both voices.
a. The glissando in the second voice was not written to the XML.
b. In measures 48 and 50, the text "gliss." is written to the XML. - In the Bass part (staff 17), slash fills copied from the guitar part are "fixed" in the wrong place (e.g., measure 73...).
- Last measure and multi-measure repeats are mishandled in the Drumset part (staff 19). The repeats are there correctly, but the voice 2 (bass drum in this case) is also there.
To Reproduce
Steps to reproduce the behavior:
- Open attached MusicXML file (I didn't compress so I could examine the file and identify some problem, but I put it into a ZIP so I could upload it.
- Note the complaint about the XML error (Trumpet not found?). Ignore it.
- Examine measures and staves identified above to see errors.
Expected behavior
- If a Trumpet in Bb is written, then a Trumpet in Bb should be read.
- Volta only above the top staff.
- All glissandos should be written and written correctly. Overlapping glissandos shouldn't be dropped. Text should not be added back.
- Notes tied to a line should be tied to the same line as before writing the XML. If the data for the original note is not consistent, then the <unpitched> position should match what was drawn.
- In MU 4.0, repeated measures currently don't allow notes to added to the repeated measure. Nor does it appear to allow repeating only a single voice or moving the repeat symbol to a different voice. The XML indicates that a repeat symbol should be used for the measure, not just voice 1.
Screenshots
N/A
Platform information
- Windows 11
- Nightly build 230350507-4.0.2-aabbec1-x86_64
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by opening the attached Shiny_Stockings-all.zip in the reported nightly build and reproduce the MusicXML import problems in the listed measures and staves. Compare the imported score and XML with the five expected behaviors: trumpet naming, volta placement, glissandos, slash fills, and drumset repeats. Done requires resolving all five areas, so the work should be split into smaller issues before a first contribution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100