]> git.donarmstrong.com Git - lilypond.git/commitdiff
MusicXML: Fix chord conversion
authorReinhold Kainhofer <reinhold@kainhofer.com>
Sun, 2 Sep 2007 23:04:46 +0000 (01:04 +0200)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Thu, 6 Sep 2007 14:15:36 +0000 (16:15 +0200)
Fix the conversion of chords from MusicXML to lilypond. The problem was
that the #text entries in the XML tree (converted to a musicxml.Hash_text
python instance) messed up the tracking of the current positions
in Part.interpret. As soon as these children are ignored, the original
algorithm to assign measure positions works again.

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

index e00bc07d2eb6ea0e7423531ac8a417848958cdf6..8390671425c7d505bde2f92eab8ec5721c1658a0 100644 (file)
@@ -168,6 +168,8 @@ class Duration (Music_xml_node):
 
 class Hash_comment (Music_xml_node):
     pass
+class Hash_text (Music_xml_node):
+    pass
 
 class Pitch (Music_xml_node):
     def get_step (self):
@@ -429,6 +431,8 @@ class Part (Music_xml_node):
             measure_start_moment = now
             measure_position = Rational (0)
            for n in m.get_all_children ():
+                if isinstance (n, Hash_text):
+                    continue
                dur = Rational (0)
 
                 if n.__class__ == Attributes:
@@ -636,6 +640,7 @@ class Bend (Music_xml_node):
 ## used by class name or extend Music_xml_node in some way!
 class_dict = {
        '#comment': Hash_comment,
+        '#text': Hash_text,
        'accidental': Accidental,
        'attributes': Attributes,
        'beam' : Beam,