diff --git a/src/tja2fumen/constants.py b/src/tja2fumen/constants.py index 221efa6..1dbe16e 100644 --- a/src/tja2fumen/constants.py +++ b/src/tja2fumen/constants.py @@ -43,7 +43,7 @@ FUMEN_NOTE_TYPES = { } FUMEN_TYPE_NOTES = {v: k for k, v in FUMEN_NOTE_TYPES.items()} -BRANCH_NAMES = ("normal", "advanced", "master") +BRANCH_NAMES = ("normal", "professional", "master") TJA_COURSE_NAMES = [] for difficulty in ['Ura', 'Oni', 'Hard', 'Normal', 'Easy']: diff --git a/src/tja2fumen/converters.py b/src/tja2fumen/converters.py index 042888c..95ce197 100644 --- a/src/tja2fumen/converters.py +++ b/src/tja2fumen/converters.py @@ -122,7 +122,7 @@ def convert_tja_to_fumen(tja): ) # Iterate through the different branches in the TJA - total_notes = {'normal': 0, 'advanced': 0, 'master': 0} + total_notes = {'normal': 0, 'professional': 0, 'master': 0} for current_branch, branch_measures_tja_processed in processed_tja_branches.items(): if not len(branch_measures_tja_processed): continue @@ -218,7 +218,7 @@ def convert_tja_to_fumen(tja): vals.append(0) if current_branch == 'normal': measure_fumen.branch_info[0:2] = vals - elif current_branch == 'advanced': + elif current_branch == 'professional': measure_fumen.branch_info[2:4] = vals elif current_branch == 'master': measure_fumen.branch_info[4:6] = vals @@ -239,7 +239,7 @@ def convert_tja_to_fumen(tja): measure_fumen.branch_info[0:2] = (branch_condition[1:] if measure_tja_processed.section or not measure_tja_processed.section and not branch_conditions else [999, 999]) - elif current_branch == 'advanced': + elif current_branch == 'professional': measure_fumen.branch_info[2:4] = branch_condition[1:] elif current_branch == 'master': measure_fumen.branch_info[4:6] = (branch_condition[1:] if measure_tja_processed.section or @@ -331,9 +331,9 @@ def convert_tja_to_fumen(tja): fumen.header.b496_b499_branch_points_balloon = 0 fumen.header.b500_b503_branch_points_kusudama = 0 - # Compute the ratio between normal and advanced/master branches (just in case the note counts differ) - if total_notes['advanced']: - fumen.header.b460_b463_normal_professional_ratio = int(65536 * (total_notes['normal'] / total_notes['advanced'])) + # Compute the ratio between normal and professional/master branches (just in case the note counts differ) + if total_notes['professional']: + fumen.header.b460_b463_normal_professional_ratio = int(65536 * (total_notes['normal'] / total_notes['professional'])) if total_notes['master']: fumen.header.b464_b467_normal_master_ratio = int(65536 * (total_notes['normal'] / total_notes['master'])) diff --git a/src/tja2fumen/parsers.py b/src/tja2fumen/parsers.py index 3f41e2a..7258943 100644 --- a/src/tja2fumen/parsers.py +++ b/src/tja2fumen/parsers.py @@ -197,7 +197,7 @@ def parse_course_measures(course): current_branch = 'normal' idx_m = idx_m_branchstart elif line.name == 'E': - current_branch = 'advanced' + current_branch = 'professional' idx_m = idx_m_branchstart elif line.name == 'M': current_branch = 'master' @@ -365,6 +365,6 @@ def read_fumen(fumen_file, exclude_empty_measures=False): # a converted non-official TJA, then it's useful to exclude the empty measures. if exclude_empty_measures: song.measures = [m for m in song.measures - if m.branches['normal'].length or m.branches['advanced'].length or m.branches['master'].length] + if m.branches['normal'].length or m.branches['professional'].length or m.branches['master'].length] return song diff --git a/src/tja2fumen/types.py b/src/tja2fumen/types.py index c596b42..e55a985 100644 --- a/src/tja2fumen/types.py +++ b/src/tja2fumen/types.py @@ -27,7 +27,7 @@ class TJACourse: self.data = [] self.branches = { 'normal': [TJAMeasure()], - 'advanced': [TJAMeasure()], + 'professional': [TJAMeasure()], 'master': [TJAMeasure()] } @@ -100,7 +100,7 @@ class FumenMeasure: self.barline = barline self.branch_start = branch_start self.branch_info = [-1, -1, -1, -1, -1, -1] if branch_info is None else branch_info - self.branches = {'normal': FumenBranch(), 'advanced': FumenBranch(), 'master': FumenBranch()} + self.branches = {'normal': FumenBranch(), 'professional': FumenBranch(), 'master': FumenBranch()} self.padding1 = padding1 self.padding2 = padding2 diff --git a/testing/test_conversion.py b/testing/test_conversion.py index 9929b42..4923d11 100644 --- a/testing/test_conversion.py +++ b/testing/test_conversion.py @@ -120,7 +120,7 @@ def test_converted_tja_vs_cached_fumen(id_song, tmp_path, entry_point): assert_song_property(co_measure, ca_measure, 'branch_info', i_measure) # 3b. Check measure notes - for i_branch in ['normal', 'advanced', 'master']: + for i_branch in ['normal', 'professional', 'master']: co_branch = co_measure.branches[i_branch] ca_branch = ca_measure.branches[i_branch] # NB: We only check speed for non-empty branches, as fumens store speed changes even for empty branches