]> git.donarmstrong.com Git - lilypond.git/commitdiff
MusicXML: handle harmony and direction after inserting bar checks
authorReinhold Kainhofer <reinhold@kainhofer.com>
Tue, 11 Nov 2008 23:17:21 +0000 (00:17 +0100)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Tue, 11 Nov 2008 23:17:21 +0000 (00:17 +0100)
Harmony and Direction elements should come AFTER the bar check, since
they already start the new measure and count as the first element.

scripts/musicxml2ly.py

index a2e09e87e29b4beeeffee04556ed34c7ae0d3d7c..a55ae8e4302bc3b81f445dd1caf714d92ba902bc 100644 (file)
@@ -1761,31 +1761,6 @@ def musicxml_voice_to_lily_voice (voice):
             if a:
                 voice_builder.add_partial (a)
             continue
-
-        if isinstance (n, musicxml.Direction):
-            for a in musicxml_direction_to_lily (n):
-                if a.wait_for_note ():
-                    voice_builder.add_dynamics (a)
-                else:
-                    voice_builder.add_command (a)
-            continue
-
-        if isinstance (n, musicxml.Harmony):
-            for a in musicxml_harmony_to_lily (n):
-                if a.wait_for_note ():
-                    voice_builder.add_dynamics (a)
-                else:
-                    voice_builder.add_command (a)
-            for a in musicxml_harmony_to_lily_chordname (n):
-                pending_chordnames.append (a)
-            continue
-
-        if isinstance (n, musicxml.FiguredBass):
-            a = musicxml_figured_bass_to_lily (n)
-            if a:
-                pending_figured_bass.append (a)
-            continue
-
         is_chord = n.get_maybe_exist_named_child ('chord')
         if not is_chord:
             try:
@@ -1828,6 +1803,31 @@ def musicxml_voice_to_lily_voice (voice):
             voice_builder.add_multibar_rest (n._duration)
             continue
 
+
+        if isinstance (n, musicxml.Direction):
+            for a in musicxml_direction_to_lily (n):
+                if a.wait_for_note ():
+                    voice_builder.add_dynamics (a)
+                else:
+                    voice_builder.add_command (a)
+            continue
+
+        if isinstance (n, musicxml.Harmony):
+            for a in musicxml_harmony_to_lily (n):
+                if a.wait_for_note ():
+                    voice_builder.add_dynamics (a)
+                else:
+                    voice_builder.add_command (a)
+            for a in musicxml_harmony_to_lily_chordname (n):
+                pending_chordnames.append (a)
+            continue
+
+        if isinstance (n, musicxml.FiguredBass):
+            a = musicxml_figured_bass_to_lily (n)
+            if a:
+                pending_figured_bass.append (a)
+            continue
+
         if isinstance (n, musicxml.Attributes):
             for a in musicxml_attributes_to_lily (n):
                 voice_builder.add_command (a)