Closed GoogleCodeExporter closed 9 years ago
Diving into the xml, the 2 errors are generated by backup blocks.
<backup>
<duration>48</duration>
</backup>
Original comment by shao...@gmail.com
on 29 Oct 2012 at 11:23
I'm not sure if this will be helpful, but here is an edited version of the xml
down to where the error occurs.
Original comment by shao...@gmail.com
on 29 Oct 2012 at 11:42
Attachments:
[deleted comment]
Hi Shao Lo,
I was able to reproduce your problem both by "moonlight.xml" and
"http://static.musescore.com/30321/cc9927b018/score.mxl"
Looking at the xml:
<note default-x="227.02" default-y="-120.00">
<pitch>
<step>F</step>
<alter>5</alter>
<octave>3</octave>
</pitch>
<duration>4</duration>
<voice>1</voice>
<type>eighth</type>
<time-modification>
<actual-notes>3</actual-notes>
<normal-notes>2</normal-notes>
</time-modification>
<stem>up</stem>
<staff>2</staff>
<beam number="1">continue</beam>
</note>
And the accidental <alter>5</alter> does not make sense to me, because the
value is usually -2 to -2.
I tried using museScore to uncompress the mxl instead of loading directly by
Music21; it succeeded and I could not find any alter=5 (that xml loads to
music21 perfectly, too)
IMHO it looks more like there is a bug in music21 parsing mxl file. Will update
if there is any new findings.
Original comment by OsbertN...@gmail.com
on 5 Mar 2013 at 12:16
Hi Shao Lo,
To cut it short, there are lots of unreasonable chromatic alterations in the
mxl file that trigger the error. The reason why MuseScore does not complain is
because MuseScore simply ignores the erroneous alterations and by default set
it to 0, at the expense of incorrect pitch.
If you open the file via MuseScore, you can spot some errors in Bar 12, where
the last 3 eighth notes read D3, A3, C4, while the correct ones should be F#3,
C#4 and E4. Extracted to xml file Line 3518 - 3555 shows the 3 notes are
notated as:
D3(####), A3(####),C4(####)
Which, if you really count the sharps it adds up to the correct pitch.
There is no easy way to fix the file, but if you just want to read the file in
music 21, you can replace all "alter>3", "alter>4", "alter>5" etc into
"alter>0". However the file contain incorrect notes, exactly what you will see
in MuseScore.
Since fixing musicxml file is not a music21 feature, I would suggest to change
this issue to invalid.
Original comment by OsbertN...@gmail.com
on 23 Mar 2013 at 1:20
Agreed that it's not a music21 error -- though I have seen some of these issues
arise before from one musicxml creator, I think that I might put a patch to
ignore |alter| > 4 since it's not valid musicxml. thanks!
Original comment by cuthbert
on 9 Apr 2013 at 6:30
Original issue reported on code.google.com by
shao...@gmail.com
on 29 Oct 2012 at 11:04Attachments: