From d2af367f2d350780292a270b3345ee97142b920d Mon Sep 17 00:00:00 2001 From: Thibaud Date: Wed, 29 May 2024 14:41:34 +0200 Subject: [PATCH] Fix dumb type errors (2) --- place.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/place.py b/place.py index 560056a..860da90 100644 --- a/place.py +++ b/place.py @@ -6,8 +6,8 @@ QUARTER = 1 HALF = 2 NOTE = 4 -def beatify(bpm:float, offset:int, time_ms:timedelta) -> float: - return bpm/60000 * (time_ms - offset) +def beatify(bpm:float, offset:int, time:timedelta) -> float: + return bpm/60000 * (time.total_seconds()*1000 - offset) def debeatify(bpm:float, offset:int, beat:int) -> timedelta: return timedelta(milliseconds=(beat*60000/bpm) + offset) @@ -20,8 +20,8 @@ def greedy(bpm:int, offset:int, timings:list, amplitudes:list): output: list of object type / position """ flow = 1 - notes = [sl.HitObject(0, timedelta(milliseconds=0), 0) * len(timings)] - beats = np.array(beatify(timings)) + notes = [sl.HitObject(0, timedelta(milliseconds=0), 0)] * len(timings) + beats = [beatify(bpm, offset, timing) for timing in timings] for (delta, note_beat, intensity, i) in zip(timings, beats, amplitudes, range(len(timings))): try: duration = note_beat - beats[i + 1]