From eca89fe0b3188095a07c176632acb5e747dfab48 Mon Sep 17 00:00:00 2001 From: Evangeline Sutherland Date: Thu, 14 Sep 2023 04:44:47 -0400 Subject: [PATCH] fix bug in generate-mpe.py lots of rows have values that won't be converted to int values before first being converted from float values --- generate-mpe.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/generate-mpe.py b/generate-mpe.py index ea7bc32..e77e675 100644 --- a/generate-mpe.py +++ b/generate-mpe.py @@ -59,8 +59,8 @@ first_tick = 1e9 for row in reader: - staff = int(row[0]) - tick = int(row[2]) + staff = int(float(row[0])) + tick = int(float(row[2])) if staff > max_staff: max_staff = staff @@ -76,7 +76,7 @@ if staff_notes.get(staff) is None: staff_notes[staff] = [] - staff_notes[staff].append([int(row[1]), tick, int(row[3]), int(row[4]), float(row[5])]) + staff_notes[staff].append([int(float(row[1])), tick, int(float(row[3])), int(float(row[4])), float(row[5])]) if max_staff == -1: print("No notes found. Not exporting anything.") @@ -132,4 +132,4 @@ exit() except FileNotFoundError: print("ERROR: File not found.") - exit() \ No newline at end of file + exit()