--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.0 Partwise//EN"\r
+ "http://www.musicxml.org/dtds/partwise.dtd">\r
+<score-partwise>\r
+ <movement-title>Lyrics on notes with graces</movement-title>\r
+ <identification>\r
+ <encoding>\r
+ <software>Finale 2007 for Windows</software>\r
+ <software>Dolet Light for Finale 2007</software>\r
+ <encoding-date>2007-10-27</encoding-date>\r
+ </encoding>\r
+ </identification>\r
+ <part-list>\r
+ <score-part id="P1">\r
+ <part-name>MusicXML Part</part-name>\r
+ <score-instrument id="P1-I1">\r
+ <instrument-name>Grand Piano</instrument-name>\r
+ </score-instrument>\r
+ <midi-instrument id="P1-I1">\r
+ <midi-channel>1</midi-channel>\r
+ <midi-program>1</midi-program>\r
+ </midi-instrument>\r
+ </score-part>\r
+ </part-list>\r
+ <!--=========================================================-->\r
+ <part id="P1">\r
+ <measure number="1">\r
+ <attributes>\r
+ <divisions>2</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
+ <sound tempo="120"/>\r
+ <note>\r
+ <pitch>\r
+ <step>G</step>\r
+ <octave>4</octave>\r
+ </pitch>\r
+ <duration>2</duration>\r
+ <voice>1</voice>\r
+ <type>quarter</type>\r
+ <stem>up</stem>\r
+ <notations>\r
+ <slur number="1" type="start"/>\r
+ </notations>\r
+ <lyric number="1">\r
+ <syllabic>begin</syllabic>\r
+ <text>Ly</text>\r
+ </lyric>\r
+ </note>\r
+ <note>\r
+ <grace slash="yes"/>\r
+ <pitch>\r
+ <step>D</step>\r
+ <octave>5</octave>\r
+ </pitch>\r
+ <voice>1</voice>\r
+ <type>eighth</type>\r
+ <stem>up</stem>\r
+ </note>\r
+ <note>\r
+ <pitch>\r
+ <step>C</step>\r
+ <octave>5</octave>\r
+ </pitch>\r
+ <duration>2</duration>\r
+ <voice>1</voice>\r
+ <type>quarter</type>\r
+ <stem>down</stem>\r
+ <notations>\r
+ <slur number="1" type="stop"/>\r
+ </notations>\r
+ </note>\r
+ <note>\r
+ <pitch>\r
+ <step>C</step>\r
+ <octave>5</octave>\r
+ </pitch>\r
+ <duration>2</duration>\r
+ <voice>1</voice>\r
+ <type>quarter</type>\r
+ <stem>down</stem>\r
+ <lyric number="1">\r
+ <syllabic>end</syllabic>\r
+ <text>rics</text>\r
+ </lyric>\r
+ </note>\r
+ <note>\r
+ <grace slash="yes"/>\r
+ <pitch>\r
+ <step>D</step>\r
+ <octave>5</octave>\r
+ </pitch>\r
+ <tie type="start"/>\r
+ <voice>1</voice>\r
+ <type>eighth</type>\r
+ <stem>up</stem>\r
+ <notations>\r
+ <tied type="start"/>\r
+ </notations>\r
+ </note>\r
+ <note>\r
+ <pitch>\r
+ <step>C</step>\r
+ <octave>5</octave>\r
+ </pitch>\r
+ <duration>2</duration>\r
+ <voice>1</voice>\r
+ <type>quarter</type>\r
+ <stem>down</stem>\r
+ <lyric number="1">\r
+ <syllabic>single</syllabic>\r
+ <text>on</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>2</duration>\r
+ <tie type="start"/>\r
+ <voice>1</voice>\r
+ <type>quarter</type>\r
+ <stem>down</stem>\r
+ <notations>\r
+ <tied type="start"/>\r
+ </notations>\r
+ <lyric number="1">\r
+ <syllabic>single</syllabic>\r
+ <text>notes</text>\r
+ <extend/>\r
+ </lyric>\r
+ </note>\r
+ <note>\r
+ <grace/>\r
+ <pitch>\r
+ <step>E</step>\r
+ <octave>5</octave>\r
+ </pitch>\r
+ <tie type="start"/>\r
+ <voice>1</voice>\r
+ <type>eighth</type>\r
+ <stem>up</stem>\r
+ <beam number="1">begin</beam>\r
+ <notations>\r
+ <tied type="start"/>\r
+ </notations>\r
+ </note>\r
+ <note>\r
+ <grace/>\r
+ <pitch>\r
+ <step>D</step>\r
+ <octave>5</octave>\r
+ </pitch>\r
+ <voice>1</voice>\r
+ <type>eighth</type>\r
+ <stem>up</stem>\r
+ <beam number="1">end</beam>\r
+ </note>\r
+ <note>\r
+ <pitch>\r
+ <step>C</step>\r
+ <octave>5</octave>\r
+ </pitch>\r
+ <duration>2</duration>\r
+ <tie type="stop"/>\r
+ <voice>1</voice>\r
+ <type>quarter</type>\r
+ <stem>down</stem>\r
+ <notations>\r
+ <tied type="stop"/>\r
+ </notations>\r
+ </note>\r
+ <note>\r
+ <grace/>\r
+ <pitch>\r
+ <step>D</step>\r
+ <octave>5</octave>\r
+ </pitch>\r
+ <voice>1</voice>\r
+ <type>eighth</type>\r
+ <stem>up</stem>\r
+ </note>\r
+ <note>\r
+ <pitch>\r
+ <step>C</step>\r
+ <octave>5</octave>\r
+ </pitch>\r
+ <duration>2</duration>\r
+ <voice>1</voice>\r
+ <type>quarter</type>\r
+ <stem>down</stem>\r
+ <lyric number="1">\r
+ <syllabic>single</syllabic>\r
+ <text>with</text>\r
+ </lyric>\r
+ </note>\r
+ <note>\r
+ <pitch>\r
+ <step>C</step>\r
+ <octave>5</octave>\r
+ </pitch>\r
+ <duration>2</duration>\r
+ <voice>1</voice>\r
+ <type>quarter</type>\r
+ <stem>down</stem>\r
+ <lyric number="1">\r
+ <syllabic>single</syllabic>\r
+ <text>graces</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
for n in voice._elements:
if n.get_name () == 'forward':
continue
+ staff = n.get_maybe_exist_named_child ('staff')
+ if staff:
+ staff = staff.get_text ()
+ if current_staff and staff <> current_staff and not n.get_maybe_exist_named_child ('chord'):
+ voice_builder.add_command (musicexp.StaffChange (staff))
+ current_staff = staff
if isinstance (n, musicxml.Partial) and n.partial > 0:
a = musicxml_partial_to_lily (n.partial)
is_chord = n.get_maybe_exist_named_child ('chord')
if not is_chord:
- s = n.get_maybe_exist_named_child ('staff')
- if s:
- staff = s.get_text ()
- if current_staff and staff <> current_staff:
- voice_builder.add_command (musicexp.StaffChange (staff))
- current_staff = staff
try:
voice_builder.jumpto (n._when)
except NegativeSkip, neg:
if len (slurs) > 1:
error_message ('more than 1 slur?')
# record the slur status for the next note in the loop
- if slurs[0].get_type () == 'start':
- inside_slur = True
- elif slurs[0].get_type () == 'stop':
- inside_slur = False
+ if not grace:
+ if slurs[0].get_type () == 'start':
+ inside_slur = True
+ elif slurs[0].get_type () == 'stop':
+ inside_slur = False
lily_ev = musicxml_spanner_to_lily_event (slurs[0])
ev_chord.append (lily_ev)
- mxl_tie = notations.get_tie ()
- if mxl_tie and mxl_tie.type == 'start':
- ev_chord.append (musicexp.TieEvent ())
- is_tied = True
- else:
- is_tied = False
+ if not grace:
+ mxl_tie = notations.get_tie ()
+ if mxl_tie and mxl_tie.type == 'start':
+ ev_chord.append (musicexp.TieEvent ())
+ is_tied = True
+ else:
+ is_tied = False
fermatas = notations.get_named_children ('fermata')
for a in fermatas: