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

Fix #315904: [MusicXML import] incomplete import from ScoreScan XML file #7442

Merged
merged 1 commit into from
Feb 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion importexport/musicxml/importmxmlpass2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5671,7 +5671,6 @@ void MusicXMLParserNotations::technical()
_e.attributes(), "technical");
notation.setText(_e.readElementText());
_notations.push_back(notation);
_e.readNext();
}
else if (_e.name() == "harmonic") {
harmonic();
Expand Down
85 changes: 85 additions & 0 deletions mtest/musicxml/io/testLessWhiteSpace.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 3.1 Partwise//EN" "http://www.musicxml.org/dtds/partwise.dtd">
<score-partwise version="3.1">
<work>
<work-number>MuseScore testfile</work-number>
<work-title>Less white-space</work-title>
</work>
<identification>
<encoding>
<software>MuseScore 0.7.0</software>
<encoding-date>2007-09-10</encoding-date>
<supports element="accidental" type="yes"/>
<supports element="beam" type="yes"/>
<supports element="print" attribute="new-page" type="no"/>
<supports element="print" attribute="new-system" type="no"/>
<supports element="stem" type="yes"/>
</encoding>
<miscellaneous>
<miscellaneous-field name="description">
ScanScore sometimes puts end elements together on a single line.
This may expose parser bugs, e.g. incorrectly using readNext().
</miscellaneous-field>
</miscellaneous>
</identification>
<part-list>
<score-part id="P1">
<part-name>Classical Guitar</part-name>
<part-abbreviation>Guit.</part-abbreviation>
<score-instrument id="P1-I1">
<instrument-name>Classical Guitar</instrument-name>
</score-instrument>
<midi-device id="P1-I1" port="1"></midi-device>
<midi-instrument id="P1-I1">
<midi-channel>1</midi-channel>
<midi-program>25</midi-program>
<volume>78.7402</volume>
<pan>0</pan>
</midi-instrument>
</score-part>
</part-list>
<part id="P1">
<measure number="1">
<attributes>
<divisions>1</divisions>
<key>
<fifths>0</fifths>
</key>
<time>
<beats>4</beats>
<beat-type>4</beat-type>
</time>
<clef>
<sign>G</sign>
<line>2</line>
<clef-octave-change>-1</clef-octave-change>
</clef>
</attributes>
<note>
<pitch>
<step>A</step>
<octave>3</octave>
</pitch>
<duration>2</duration>
<voice>1</voice>
<type>half</type>
<stem>up</stem>
<notations>
<technical>
<fingering>1</fingering></technical></notations></note>
<note>
<pitch>
<step>B</step>
<octave>3</octave>
</pitch>
<duration>2</duration>
<voice>1</voice>
<type>half</type>
<stem>up</stem>
</note>
<barline location="right">
<bar-style>light-heavy</bar-style>
</barline>
</measure>
</part>
</score-partwise>
82 changes: 82 additions & 0 deletions mtest/musicxml/io/testLessWhiteSpace_ref.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 3.1 Partwise//EN" "http://www.musicxml.org/dtds/partwise.dtd">
<score-partwise version="3.1">
<work>
<work-number>MuseScore testfile</work-number>
<work-title>Less white-space</work-title>
</work>
<identification>
<encoding>
<software>MuseScore 0.7.0</software>
<encoding-date>2007-09-10</encoding-date>
<supports element="accidental" type="yes"/>
<supports element="beam" type="yes"/>
<supports element="print" attribute="new-page" type="no"/>
<supports element="print" attribute="new-system" type="no"/>
<supports element="stem" type="yes"/>
</encoding>
</identification>
<part-list>
<score-part id="P1">
<part-name>Classical Guitar</part-name>
<part-abbreviation>Guit.</part-abbreviation>
<score-instrument id="P1-I1">
<instrument-name>Classical Guitar</instrument-name>
</score-instrument>
<midi-device id="P1-I1" port="1"></midi-device>
<midi-instrument id="P1-I1">
<midi-channel>1</midi-channel>
<midi-program>25</midi-program>
<volume>78.7402</volume>
<pan>0</pan>
</midi-instrument>
</score-part>
</part-list>
<part id="P1">
<measure number="1">
<attributes>
<divisions>1</divisions>
<key>
<fifths>0</fifths>
</key>
<time>
<beats>4</beats>
<beat-type>4</beat-type>
</time>
<clef>
<sign>G</sign>
<line>2</line>
<clef-octave-change>-1</clef-octave-change>
</clef>
</attributes>
<note>
<pitch>
<step>A</step>
<octave>3</octave>
</pitch>
<duration>2</duration>
<voice>1</voice>
<type>half</type>
<stem>up</stem>
<notations>
<technical>
<fingering>1</fingering>
</technical>
</notations>
</note>
<note>
<pitch>
<step>B</step>
<octave>3</octave>
</pitch>
<duration>2</duration>
<voice>1</voice>
<type>half</type>
<stem>up</stem>
</note>
<barline location="right">
<bar-style>light-heavy</bar-style>
</barline>
</measure>
</part>
</score-partwise>
1 change: 1 addition & 0 deletions mtest/musicxml/io/tst_mxml_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ private slots:
void invisibleElements() { mxmlIoTest("testInvisibleElements"); }
void keysig1() { mxmlIoTest("testKeysig1"); }
void keysig2() { mxmlIoTest("testKeysig2"); }
void lessWhiteSpace() { mxmlIoTestRef("testLessWhiteSpace"); }
void lines1() { mxmlIoTest("testLines1"); }
void lines2() { mxmlIoTest("testLines2"); }
void lines3() { mxmlIoTest("testLines3"); }
Expand Down