From c0327df093131ab50da266a857d7af81d6c5c389 Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Sun, 23 Dec 2007 23:19:50 +0100 Subject: [PATCH] MusicXML: Don't crash on multiple triplet children Finale seems to produce xml files that contain tags with possibly multiple tags, in particular when a tuplet is only for one note (with tremolo subdivisions)... This patch only fixes the crash, but does not handle the logic behind this correctly :-( --- python/musicxml.py | 4 ++-- scripts/musicxml2ly.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/python/musicxml.py b/python/musicxml.py index 6949fe28d5..63296f193e 100644 --- a/python/musicxml.py +++ b/python/musicxml.py @@ -700,8 +700,8 @@ class Notations (Music_xml_node): else: return None - def get_tuplet (self): - return self.get_maybe_exist_typed_child (Tuplet) + def get_tuplets (self): + return self.get_typed_children (Tuplet) class Time_modification(Music_xml_node): def get_fraction (self): diff --git a/scripts/musicxml2ly.py b/scripts/musicxml2ly.py index 43dc29f7cb..5884f536b9 100644 --- a/scripts/musicxml2ly.py +++ b/scripts/musicxml2ly.py @@ -1404,8 +1404,7 @@ def musicxml_voice_to_lily_voice (voice): # +fermata | arpeggiate | non-arpeggiate | # accidental-mark | other-notation for notations in notations_children: - if notations.get_tuplet(): - tuplet_event = notations.get_tuplet() + for tuplet_event in notations.get_tuplets(): mod = n.get_maybe_exist_typed_child (musicxml.Time_modification) frac = (1,1) if mod: -- 2.39.2