]> git.donarmstrong.com Git - lilypond.git/commitdiff
MusicXML: Fix problem with dynamics inserted too late
authorReinhold Kainhofer <reinhold@kainhofer.com>
Fri, 21 Sep 2007 22:37:48 +0000 (00:37 +0200)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Wed, 3 Oct 2007 16:40:11 +0000 (18:40 +0200)
Insert dynamics right into the EventChord, not after it. This fixes
several errors with my test files (the Recordare MusicXML samples).

Signed-off-by: Reinhold Kainhofer <reinhold@kainhofer.com>
scripts/musicxml2ly.py

index 9502e16bc602ce5441333e5e15d923695ba0ba1c..857333ca2025e2f856c8d08f999a0e24f0dc937e 100644 (file)
@@ -549,9 +549,9 @@ class LilyPondVoiceBuilder:
         self.set_duration (duration)
         
         # Insert all pending dynamics right after the note/rest:
-        if duration > Rational (0):
+        if isinstance (music, musicexp.EventChord) and self.pending_dynamics:
             for d in self.pending_dynamics:
-                self.elements.append (d)
+                music.append (d)
             self.pending_dynamics = []
 
     # Insert some music command that does not affect the position in the measure
@@ -619,6 +619,9 @@ def musicxml_voice_to_lily_voice (voice):
     modes_found = {}
     lyrics = {}
         
+    # TODO: Make sure that the keys in the dict don't get reordered, since
+    #       we need the correct ordering of the lyrics stanzas! By default,
+    #       a dict will reorder its keys
     for k in voice.get_lyrics_numbers ():
         lyrics[k] = []