1
0
mirror of synced 2025-01-24 15:12:19 +01:00

converters.py: Fix drumroll duration bug

The duration calculation wasn't taking into account the starting position of the drumroll, so the drumrolls ended up with a duration that was way too long.

Fixes #1.
This commit is contained in:
Viv 2023-06-03 13:28:20 -04:00
parent 84056aef27
commit 1953ffbc23

View File

@ -153,7 +153,7 @@ def convertTJAToFumen(fumen, tja):
note_pos = measureDurationBase * (data['pos'] - measureTJA['pos_start']) / measureLength note_pos = measureDurationBase * (data['pos'] - measureTJA['pos_start']) / measureLength
# The duration of the current drumroll is the position of the drumroll-end note. # The duration of the current drumroll is the position of the drumroll-end note.
if data['value'] == "EndDRB": if data['value'] == "EndDRB":
currentDrumroll['duration'] += note_pos currentDrumroll['duration'] += (note_pos - currentDrumroll['pos'])
# 1182, 1385, 1588, 2469, 1568, 752, 1568 # 1182, 1385, 1588, 2469, 1568, 752, 1568
currentDrumroll['duration'] = float(int(currentDrumroll['duration'])) currentDrumroll['duration'] = float(int(currentDrumroll['duration']))
currentDrumroll = None currentDrumroll = None