1
0
mirror of synced 2025-01-24 23:13:40 +01:00

converters.py: Make 'note' its own case

This commit is contained in:
Viv 2023-06-02 16:33:46 -04:00
parent 1f76b19e69
commit dcc37ff0dd

View File

@ -67,7 +67,9 @@ def preprocessTJAMeasures(tja):
'pos_start': 0, 'pos_end': 0, 'time_sig': measure['length'], 'pos_start': 0, 'pos_end': 0, 'time_sig': measure['length'],
'data': [], 'properties': measure['properties']} 'data': [], 'properties': measure['properties']}
for data in combined: for data in combined:
if data['type'] == 'bpm': if data['type'] == 'note':
measure_cur['data'].append(data)
elif data['type'] == 'bpm':
currentBPM = float(data['value']) currentBPM = float(data['value'])
# Case 1: BPM change at the start of a measure; just change BPM # Case 1: BPM change at the start of a measure; just change BPM
if data['pos'] == 0: if data['pos'] == 0:
@ -82,7 +84,7 @@ def preprocessTJAMeasures(tja):
elif data['type'] == 'scroll': elif data['type'] == 'scroll':
currentScroll = data['value'] currentScroll = data['value']
measure_cur['scroll'] = currentScroll measure_cur['scroll'] = currentScroll
# 'else' == Note data, and non-bpm/scroll events # 'else' non-bpm/scroll events
else: else:
measure_cur['data'].append(data) measure_cur['data'].append(data)
measure_cur['pos_end'] = len(measure['data']) measure_cur['pos_end'] = len(measure['data'])