From: Reinhold Kainhofer Date: Tue, 23 Oct 2007 21:32:23 +0000 (+0200) Subject: MusicXML: Also finish repeats that do not have an explicit ending bar X-Git-Tag: release/2.11.35-1~79 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=92ac6b5a04901c03df80f33ec6805957cee7d63a;p=lilypond.git MusicXML: Also finish repeats that do not have an explicit ending bar Some musicXML examples just display the first page of a multi-page score. Sometimes a repeat occurs on these pages with no ending bar (which would follow on a subsequent page). Simply finish the \repeat sequence at the very end of the page. --- diff --git a/scripts/musicxml2ly.py b/scripts/musicxml2ly.py index b81c9e8344..d8b184ef43 100644 --- a/scripts/musicxml2ly.py +++ b/scripts/musicxml2ly.py @@ -193,6 +193,7 @@ def group_repeats (music_list): ending_start = -1 # position of current ending start endings = [] # list of already finished endings pos = 0 + last = len (music_list) - 1 repeat_replaced = False final_marker = 0 while pos < len (music_list) and not repeat_replaced: @@ -234,6 +235,17 @@ def group_repeats (music_list): if repeat_start >= 0 and repeat_end > 0 and ending_start < 0: repeat_finished = True + # Finish off all repeats without explicit ending bar (e.g. when + # we convert only one page of a multi-page score with repeats) + if pos == last and repeat_start >= 0: + repeat_finished = True + final_marker = pos + if repeat_end < 0: + repeat_end = pos + if ending_start >= 0: + endings.append ([ending_start, pos]) + ending_start = -1 + if repeat_finished: # We found the whole structure replace it! r = musicexp.RepeatedMusic ()