musescore / MuseScore

MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!
https://musescore.org
Other
12.27k stars 2.66k forks source link

xml import: pickup bars and danish lyrics #24602

Open Oldcamel86 opened 1 month ago

Oldcamel86 commented 1 month ago

Issue type

Import/export issue

Description with steps to reproduce

  1. Open the attached xml, which contains a pickup bar (1 beat) and i pickup bar again in measure 9 (1 beat). It also contains danish lyrics with letter ø and å.
  2. Compare the attached images. The picture from Sibelius is the same xml, imported into Sibelius. This is how the score should look. I have marked the relevant places with red circles.

Supporting files, videos and screenshots

Pickup bars and danish lyrics.xml.zip

Import into Sibelius Import Musescore 4 4 1

What is the latest version of MuseScore Studio where this issue is present?

4.4.1

Regression

I was unable to check

Operating system

Mac OS 14.4.1, maybe others

Additional context

Origin of xml is lesser known notation software Primus (www.columbussoft.de). Even though xml might not be a fixed standard, it would be nice, if Musescore could handle the pickup bars correct.

Checklist

Jojo-Schmitz commented 1 month ago

MuseScore 3.6.2 gets the Danish characters right, so at least that part is a regression

Jojo-Schmitz commented 1 month ago
<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.1 Partwise//EN" "http://www.musicxml.org/dtds/partwise.dtd">

MusicXML 1.1, Pretty antediluvian...

Oldcamel86 commented 1 month ago

@Jojo-Schmitz I do agree it is old, but would'nt it be nice to be able to import it better anyway? I have quite a lot of scores, which I only can export using this format.

lvinken commented 1 month ago

With respect to the Danish characters, that is a 4.4 regression, 4.3 imports those correctly. Note that the file is encoded in ISO-8859-1. Does the new muse::XmlStreamReader support that ? On import, the following errors are reported on the command line: 11:04:47.486 | ERROR | main_thread | UtfCodec::utf8to16 | Invalid UTF-8 11:04:47.491 | ERROR | main_thread | UtfCodec::utf8to16 | Invalid UTF-8 11:04:47.503 | ERROR | main_thread | UtfCodec::utf8to16 | Not enough space 11:04:47.505 | ERROR | main_thread | UtfCodec::utf8to16 | Invalid UTF-8 11:04:47.508 | ERROR | main_thread | UtfCodec::utf8to16 | Invalid UTF-8 11:04:47.514 | ERROR | main_thread | UtfCodec::utf8to16 | Invalid UTF-8 11:04:47.515 | ERROR | main_thread | UtfCodec::utf8to16 | Invalid UTF-8 11:04:47.530 | ERROR | main_thread | UtfCodec::utf8to16 | Invalid UTF-8 Zip file Pickup.bars.and.danish.lyrics.xml.UTF-8.zip contains the same file recoded in UTF-8, the Danish characters import correctly.

cbjeukendrup commented 1 month ago

ISO-8859-1. Does the new muse::XmlStreamReader support that ?

No, it doesn't, unfortunately. Only UTF 8 and two variants of UTF 16, at the moment.

lvinken commented 1 month ago

The incorrect pickup bar is caused by the empty measures in the second part. MuseScore's MusicXML importer assumes the length of empty measures to be equal to the length according to the current time signature. This works OK for single part scores, but fails for this one. Fixing this could be done in MusicXMLParserPa ss1::determineMeasureLength(). Attached file Pickup.bars.and.danish.lyrics.fixed.xml.zip contains rests in the pickup bars in part two, it imports correctly.