From b50ab1c348bba9622c85ab9f53a1519d94a3f1b7 Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Mon, 3 Sep 2007 01:04:46 +0200 Subject: [PATCH] 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 --- python/musicxml.py | 5 +++++ 1 file changed, 5 insertions(+) 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, -- 2.39.5