--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.1 Partwise//EN"\r
+ "http://www.musicxml.org/dtds/partwise.dtd">\r
+<score-partwise version="1.1">\r
+ <identification>\r
+ <miscellaneous>\r
+ <miscellaneous-field name="description">Lyrics spanners: continued \r
+ syllables and extenders, possibly spanning multiple notes. The \r
+ intermediate notes do not have any <lyric> \r
+ element.</miscellaneous-field>\r
+ </miscellaneous>\r
+ </identification>\r
+ <part-list>\r
+ <score-part id="P1">\r
+ <part-name print-object="no">MusicXML Part</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>1</duration>\r
+ <voice>1</voice>\r
+ <type>quarter</type>\r
+ <lyric justify="left" number="1">\r
+ <syllabic>single</syllabic>\r
+ <text>A</text>\r
+ <extend/>\r
+ </lyric>\r
+ </note>\r
+ <note>\r
+ <pitch>\r
+ <step>C</step>\r
+ <octave>5</octave>\r
+ </pitch>\r
+ <duration>1</duration>\r
+ <voice>1</voice>\r
+ <type>quarter</type>\r
+ </note>\r
+ <note>\r
+ <pitch>\r
+ <step>C</step>\r
+ <octave>5</octave>\r
+ </pitch>\r
+ <duration>1</duration>\r
+ <voice>1</voice>\r
+ <type>quarter</type>\r
+ <lyric number="1">\r
+ <syllabic>begin</syllabic>\r
+ <text>b</text>\r
+ </lyric>\r
+ </note>\r
+ <note>\r
+ <pitch>\r
+ <step>C</step>\r
+ <octave>5</octave>\r
+ </pitch>\r
+ <duration>1</duration>\r
+ <voice>1</voice>\r
+ <type>quarter</type>\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>1</duration>\r
+ <voice>1</voice>\r
+ <type>quarter</type>\r
+ </note>\r
+ <note>\r
+ <pitch>\r
+ <step>C</step>\r
+ <octave>5</octave>\r
+ </pitch>\r
+ <duration>1</duration>\r
+ <voice>1</voice>\r
+ <type>quarter</type>\r
+ <lyric justify="left" number="1">\r
+ <syllabic>end</syllabic>\r
+ <text>CC</text>\r
+ <extend/>\r
+ </lyric>\r
+ </note>\r
+ <note>\r
+ <pitch>\r
+ <step>C</step>\r
+ <octave>5</octave>\r
+ </pitch>\r
+ <duration>1</duration>\r
+ <voice>1</voice>\r
+ <type>quarter</type>\r
+ </note>\r
+ <note>\r
+ <pitch>\r
+ <step>C</step>\r
+ <octave>5</octave>\r
+ </pitch>\r
+ <duration>1</duration>\r
+ <voice>1</voice>\r
+ <type>quarter</type>\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>1</duration>\r
+ <voice>1</voice>\r
+ <type>quarter</type>\r
+ <lyric justify="left" number="1">\r
+ <syllabic>single</syllabic>\r
+ <text>e</text>\r
+ <extend/>\r
+ </lyric>\r
+ </note>\r
+ <note>\r
+ <pitch>\r
+ <step>C</step>\r
+ <octave>5</octave>\r
+ </pitch>\r
+ <duration>1</duration>\r
+ <voice>1</voice>\r
+ <type>quarter</type>\r
+ </note>\r
+ <note>\r
+ <pitch>\r
+ <step>C</step>\r
+ <octave>5</octave>\r
+ </pitch>\r
+ <duration>1</duration>\r
+ <voice>1</voice>\r
+ <type>quarter</type>\r
+ </note>\r
+ <note>\r
+ <rest/>\r
+ <duration>1</duration>\r
+ <voice>1</voice>\r
+ <type>quarter</type>\r
+ </note>\r
+ <barline location="right">\r
+ <bar-style>light-heavy</bar-style>\r
+ </barline>\r
+ </measure>\r
+ </part>\r
+ <!--=========================================================-->\r
+</score-partwise>\r
return (text == "begin") or (text == "middle")
class Elision (Music_xml_node):
pass
+class Extend (Music_xml_node):
+ pass
class Text (Music_xml_node):
pass
'direction-type': DirType,
'duration': Duration,
'elision': Elision,
+ 'extend': Extend,
'frame': Frame,
'frame-note': Frame_Note,
'figured-bass': FiguredBass,
def musicxml_lyrics_to_text (lyrics):
# TODO: Implement text styles for lyrics syllables
continued = False
+ extended = False
text = ''
for e in lyrics.get_all_children ():
if isinstance (e, musicxml.Syllabic):
if text:
text += " "
continued = False
+ extended = False
+ elif isinstance (e, musicxml.Extend):
+ if text:
+ text += " "
+ extended = True
if text == "-" and continued:
return "--"
- elif text == "_" and continued:
+ elif text == "_" and extended:
return "__"
elif continued and text:
return musicxml.escape_ly_output_string (text) + " --"
elif continued:
return "--"
+ elif extended and text:
+ return musicxml.escape_ly_output_string (text) + " __"
+ elif extended:
+ return "__"
elif text:
return musicxml.escape_ly_output_string (text)
else: