From: Reinhold Kainhofer Date: Sun, 2 Sep 2007 23:04:46 +0000 (+0200) Subject: MusicXML: Fix chord conversion X-Git-Tag: release/2.11.33-1~4^2~17^2~4 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b50ab1c348bba9622c85ab9f53a1519d94a3f1b7;p=lilypond.git MusicXML: Fix chord conversion 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 --- diff --git a/python/musicxml.py b/python/musicxml.py index e00bc07d2e..8390671425 100644 --- a/python/musicxml.py +++ b/python/musicxml.py @@ -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,