--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 2.0 Partwise//EN"\r
+ "http://www.musicxml.org/dtds/partwise.dtd">\r
+<score-partwise version="2.0">\r
+ <identification>\r
+ <miscellaneous>\r
+ <miscellaneous-field name="description">Several ties that have their end tag missing.</miscellaneous-field>\r
+ </miscellaneous>\r
+ </identification>\r
+ <part-list>\r
+ <score-part id="P1">\r
+ <part-name></part-name>\r
+ </score-part>\r
+ </part-list>\r
+ <!--=========================================================-->\r
+ <part id="P1">\r
+ <measure number="1">\r
+ <attributes>\r
+ <divisions>1</divisions>\r
+ <key>\r
+ <fifths>0</fifths>\r
+ <mode>major</mode>\r
+ </key>\r
+ <time symbol="common">\r
+ <beats>4</beats>\r
+ <beat-type>4</beat-type>\r
+ </time>\r
+ <clef>\r
+ <sign>G</sign>\r
+ <line>2</line>\r
+ </clef>\r
+ </attributes>\r
+ <note>\r
+ <pitch>\r
+ <step>C</step>\r
+ <octave>5</octave>\r
+ </pitch>\r
+ <duration>4</duration>\r
+ <tie type="start"/>\r
+ <voice>1</voice>\r
+ <type>whole</type>\r
+ <notations>\r
+ <tied type="start"/>\r
+ </notations>\r
+ <lyric number="1">\r
+ <syllabic>end</syllabic>\r
+ <text>A</text>\r
+ </lyric>\r
+ </note>\r
+ </measure>\r
+ <!--=======================================================-->\r
+ <measure number="2">\r
+ <note>\r
+ <pitch>\r
+ <step>C</step>\r
+ <octave>5</octave>\r
+ </pitch>\r
+ <duration>4</duration>\r
+ <voice>1</voice>\r
+ <type>whole</type>\r
+ <lyric number="1">\r
+ <syllabic>end</syllabic>\r
+ <text>B</text>\r
+ </lyric>\r
+ </note>\r
+ </measure>\r
+ <!--=======================================================-->\r
+ <measure number="3">\r
+ <note>\r
+ <pitch>\r
+ <step>C</step>\r
+ <octave>5</octave>\r
+ </pitch>\r
+ <duration>4</duration>\r
+ <tie type="stop"/>\r
+ <tie type="start"/>\r
+ <voice>1</voice>\r
+ <type>whole</type>\r
+ <notations>\r
+ <tied type="stop"/>\r
+ <tied type="start"/>\r
+ </notations>\r
+ <lyric number="1">\r
+ <syllabic>end</syllabic>\r
+ <text>C</text>\r
+ </lyric>\r
+ </note>\r
+ </measure>\r
+ <!--=======================================================-->\r
+ <measure number="4">\r
+ <note>\r
+ <pitch>\r
+ <step>C</step>\r
+ <octave>5</octave>\r
+ </pitch>\r
+ <duration>4</duration>\r
+ <tie type="start"/>\r
+ <voice>1</voice>\r
+ <type>whole</type>\r
+ <notations>\r
+ <tied type="start"/>\r
+ </notations>\r
+ <lyric number="1" name="verse">\r
+ <syllabic>end</syllabic>\r
+ <text>D</text>\r
+ </lyric>\r
+ </note>\r
+ </measure>\r
+ <!--=======================================================-->\r
+ <measure number="5">\r
+ <note>\r
+ <pitch>\r
+ <step>C</step>\r
+ <octave>5</octave>\r
+ </pitch>\r
+ <duration>4</duration>\r
+ <tie type="stop"/>\r
+ <voice>1</voice>\r
+ <type>whole</type>\r
+ <notations>\r
+ <tied type="stop"/>\r
+ </notations>\r
+ <lyric number="1" name="verse">\r
+ <syllabic>end</syllabic>\r
+ <text>E</text>\r
+ </lyric>\r
+ </note>\r
+ <barline location="right">\r
+ <bar-style>light-heavy</bar-style>\r
+ </barline>\r
+ </measure>\r
+ </part>\r
+ <!--=========================================================-->\r
+</score-partwise>\r
voice_builder.set_measure_length (current_measure_length)
for n in voice._elements:
+ tie_started = False
if n.get_name () == 'forward':
continue
staff = n.get_maybe_exist_named_child ('staff')
if mxl_tie and mxl_tie.type == 'start':
ev_chord.append (musicexp.TieEvent ())
is_tied = True
+ tie_started = True
else:
is_tied = False
if not lnr in note_lyrics_processed:
lyrics[lnr].append ("\skip4")
- ## force trailing mm rests to be written out.
+ # Assume that a <tie> element only lasts for one note.
+ # This might not be correct MusicXML interpretation, but works for
+ # most cases and fixes broken files, which have the end tag missing
+ if is_tied and not tie_started:
+ is_tied = False
+
+ ## force trailing mm rests to be written out.
voice_builder.add_music (musicexp.ChordEvent (), Rational (0))
ly_voice = group_tuplets (voice_builder.elements, tuplet_events)