]> git.donarmstrong.com Git - lilypond.git/commitdiff
MusicXML: Fix wrong chord detection with mid-measure attributes
authorReinhold Kainhofer <reinhold@kainhofer.com>
Fri, 12 Oct 2007 09:18:27 +0000 (11:18 +0200)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Fri, 12 Oct 2007 09:18:27 +0000 (11:18 +0200)
Mid-measure attributes (like clef changes) need to be inserted as
commands, not as music, because that will reset the current measure
position and mess up chord detection for the following notes.

scripts/musicxml2ly.py

index e07584eae23f01cf7e1722b6c41962864889e847..ba841e0d00bd1fa73e238d7762b1e201b4b360cc 100644 (file)
@@ -608,7 +608,7 @@ class LilyPondVoiceBuilder:
     def add_bar_check (self, number):
         b = musicexp.BarCheck ()
         b.bar_number = number
-        self.add_music (b, Rational (0))
+        self.add_command (b)
 
     def jumpto (self, moment):
         current_end = self.end_moment + self.pending_multibar
@@ -705,7 +705,7 @@ def musicxml_voice_to_lily_voice (voice):
                     voice_builder.add_bar_check (number)
                 
             for a in musicxml_attributes_to_lily (n):
-                voice_builder.add_music (a, Rational (0))
+                voice_builder.add_command (a)
             continue
 
         if not n.__class__.__name__ == 'Note':