Skip to content

Commit f6743fb

Browse files
committed
fixed follow score for notes spanning multiple pages
1 parent bbe451d commit f6743fb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

easy_abc.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -7343,7 +7343,10 @@ def append_tempo(tempos, time_start, tempo):
73437343
note_stop = time_in_ms
73447344
note_on = active_notes.pop((channel, note_num), None)
73457345
if note_on is not None:
7346-
notes.append(MidiNote(note_on.start, note_stop, indices.union(note_on.indices), page_index, svg_row))
7346+
if page_index == note_on.page:
7347+
notes.append(MidiNote(note_on.start, note_stop, indices.union(note_on.indices), page_index, svg_row))
7348+
else:
7349+
notes.append(MidiNote(note_on.start, note_stop, note_on.indices, note_on.page, note_on.svg_row))
73477350
else:
73487351
m = tempo_re.match(line)
73497352
if m is not None:
@@ -7478,7 +7481,7 @@ def group_notes_by_time(self, notes):
74787481
# adding a new slice
74797482
if active_notes:
74807483
page = max([n.page for n in active_notes])
7481-
active_notes = [n for n in active_notes if n.page >= page] # prevent mingling of indices from different pages
7484+
active_notes = [n for n in active_notes if n.page == page] # prevent mingling of indices from different pages
74827485

74837486
all_indices_for_time_slice = set().union(*[n.indices for n in active_notes])
74847487
svg_row = min([n.svg_row for n in active_notes]) if active_notes else 0

0 commit comments

Comments
 (0)