1
0
mirror of synced 2024-11-28 06:50:49 +01:00

converters.py: Account for HIDDEN status

This commit is contained in:
Viv 2023-06-02 16:33:46 -04:00
parent ec6bf1db68
commit c7170d6f23

View File

@ -10,7 +10,7 @@ default_measure = {
'bpm': 0.0,
'fumenOffset': 0.0,
'gogo': False,
'hidden': False,
'hidden': True,
'padding1': 0,
'branchInfo': [-1, -1, -1, -1, -1, -1],
'padding2': 0,
@ -41,7 +41,6 @@ def preprocessTJAMeasures(tja):
currentBPM = 0
currentScroll = 1.0
currentGogo = False
currentHidden = False
measuresCorrected = []
for measure in tja['measures']:
@ -134,6 +133,14 @@ def convertTJAToFumen(fumen, tja):
measureFumen['fumenOffset'] = measureOffsetPrev + measureDurationNext
measureDurationNext = measureDuration
# Best guess at what 'hidden' status means for each measure:
# - 'True' means the measure lands on a barline (i.e. most measures)
# - 'False' means that the measure is between barlines. For example:
# 1. Measures before the first barline
# 2. Sub-measures that don't fall on the barline
if idx_m == 0 or (measureRatio != 1.0 and measureTJA['pos_start'] != 0):
measureFumen['hidden'] = False
# Create note dictionaries based on TJA measure data (containing 0's plus 1/2/3/4/etc. for notes)
note_counter = 0
for idx_d, data in enumerate(measureTJA['data']):