]> git.donarmstrong.com Git - lilypond.git/commitdiff
MusicXML: Don't crash on multiple triplet children
authorReinhold Kainhofer <reinhold@kainhofer.com>
Sun, 23 Dec 2007 22:19:50 +0000 (23:19 +0100)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Sun, 23 Dec 2007 22:19:50 +0000 (23:19 +0100)
Finale seems to produce xml files that contain <notation> tags
with possibly multiple <tuplet...> 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
scripts/musicxml2ly.py

index 6949fe28d53b89c5fc658d49d8236a8d95a8ca82..63296f193e0bfc484f118017713e8a2c369295ea 100644 (file)
@@ -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):
index 43dc29f7cb2097ddb902314ebcec75b1b6b5b3bb..5884f536b945115fe19b1b7712913cc6c565c73c 100644 (file)
@@ -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: