Fix dumb type errors (2)
This commit is contained in:
parent
4156bc8c26
commit
d2af367f2d
8
place.py
8
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]
|
||||
|
|
Loading…
Reference in New Issue