1
0
mirror of synced 2024-11-24 05:30:11 +01:00

Rename measure_tja.data to measure_tja.notes

This commit is contained in:
Viv 2023-07-31 09:21:40 -04:00
parent 73ad83d621
commit 15cbb9e62a
2 changed files with 7 additions and 7 deletions

View File

@ -76,7 +76,7 @@ class TJAMeasureProcessed:
levelhold: bool = False
branch_type: str = ''
branch_cond: tuple[float, float] = (0.0, 0.0)
data: list[TJAData] = field(default_factory=list)
notes: list[TJAData] = field(default_factory=list)
@dataclass(slots=True)

View File

@ -49,7 +49,7 @@ def process_commands(tja_branches: dict[str, list[TJAMeasure]], bpm: float) \
for data in measure_tja.combined:
# Handle note data
if data.name == 'note':
measure_tja_processed.data.append(data)
measure_tja_processed.notes.append(data)
# Handle commands that can only be placed between measures
# (i.e. no mid-measure variations)
@ -276,14 +276,14 @@ def convert_tja_to_fumen(tja: TJACourse) -> FumenCourse:
# Create notes based on TJA measure data
branch_points_measure = 0
for data in measure_tja.data:
for note_tja in measure_tja.notes:
# Compute the ms position of the note
pos_ratio = ((data.pos - measure_tja.pos_start) /
pos_ratio = ((note_tja.pos - measure_tja.pos_start) /
(measure_tja.pos_end - measure_tja.pos_start))
note_pos = measure_fumen.duration * pos_ratio
# Handle '8' notes (end of a drumroll/balloon)
if data.value == "EndDRB":
if note_tja.value == "EndDRB":
if not current_drumroll.note_type:
raise ValueError(
"'8' note encountered without matching "
@ -308,14 +308,14 @@ def convert_tja_to_fumen(tja: TJACourse) -> FumenCourse:
# The TJA spec technically allows you to place
# double-Kusudama notes. But this is unsupported in
# fumens, so just skip the second Kusudama note.
if data.value == "Kusudama" and current_drumroll.note_type:
if note_tja.value == "Kusudama" and current_drumroll.note_type:
continue
# Now that the edge cases have been taken care of ('continue'),
# we can initialize a note and handle general note metadata.
note = FumenNote()
note.pos = note_pos
note.note_type = data.value
note.note_type = note_tja.value
note.score_init = tja.score_init
note.score_diff = tja.score_diff