From: Reinhold Kainhofer Date: Tue, 18 Nov 2008 21:44:15 +0000 (+0100) Subject: MusicXML: Make tuplet detection work a bit better with nested tuplets X-Git-Tag: release/2.11.65-1~38 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=7204890da00cf5a27953a13714fbb66c7d055e1d;p=lilypond.git MusicXML: Make tuplet detection work a bit better with nested tuplets At least the script now detects the correct boundaries for nested tuplets. It does not, however, correctly group the notes. For this, the code needs to be substantially changed... --- diff --git a/scripts/musicxml2ly.py b/scripts/musicxml2ly.py index 4a04cb4af8..e2a54008e3 100644 --- a/scripts/musicxml2ly.py +++ b/scripts/musicxml2ly.py @@ -603,6 +603,7 @@ def group_tuplets (music_list, events): indices = [] + brackets = {} j = 0 for (ev_chord, tuplet_elt, fraction) in events: @@ -610,10 +611,16 @@ def group_tuplets (music_list, events): if music_list[j] == ev_chord: break j += 1 + nr = tuplet_elt.number if tuplet_elt.type == 'start': - indices.append ((j, None, fraction)) + tuplet_info = [j, None, fraction] + indices.append (tuplet_info) + brackets[nr] = tuplet_info elif tuplet_elt.type == 'stop': - indices[-1] = (indices[-1][0], j, indices[-1][2]) + bracket_info = brackets.get (nr, None) + if bracket_info: + bracket_info[1] = j + del brackets[nr] new_list = [] last = 0