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...
j = 0
for (ev_chord, tuplet_elt, fraction) in events:
j = 0
for (ev_chord, tuplet_elt, fraction) in events:
if music_list[j] == ev_chord:
break
j += 1
if music_list[j] == ev_chord:
break
j += 1
if tuplet_elt.type == 'start':
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':
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]