last_hitobject_offset = check_hitobject.offset timingPoint_BPM = round(calcurate.timingpoint(timingpoint.beat_length)) equal_scale = aveBPM / timingPoint_BPM for hitobject_i in range(len(target_hitobjects)): hitobject: classes.HitObject = target_hitobjects[hitobject_i] if hitobject_i + 1 != len(target_hitobjects): next_hitobject: classes.HitObject = target_hitobjects[hitobject_i + 1] def detail_offset(before_hitobject_offset): for beatsnap in [16, 12]: BPM_timingpoint = calcurate.timingpoint(timingPoint_BPM) beatsnap_timingpoint = BPM_timingpoint / beatsnap for beatsnap_multi in range(beatsnap + 1): answer_offset = timingpoint.offset + (beatsnap_timingpoint * beatsnap_multi) if math.floor(answer_offset) == before_hitobject_offset: return answer_offset pass pass return before_hitobject_offset next_hitobject_offset = detail_offset(next_hitobject.offset) hitobject_offset = detail_offset(hitobject.offset) answer_scale = round(equal_scale / (next_hitobject_offset - hitobject_offset) * (calcurate.timingpoint(timingPoint_BPM) / 4), 2) print(hitobject.offset, answer_scale) process_timingpoint.append(classes.TimingPoint(hitobject.offset, calcurate.inheritedpoint(answer_scale), beat, sample_set, sample_index, volume, True, effects)) pass process_parsed = classes.ParsedBeatmap(process_timingpoint, parsed_file.HitObjects) # どうやらコンソールのパスからの指定らしい... parser.parsesave(process_parsed, "./inheritedpoint.txt")
note_ms - ms_control), beat, sample_set, sample_index, volume, False, effects)) except ZeroDivisionError: result_object.TimingPoints.append( classes.TimingPoint(i, constant.zero_bpm, beat, sample_set, sample_index, volume, False, effects)) i += 1 if i == target_end_offset: result_object.TimingPoints.append( classes.TimingPoint(i, calcurate.timingpoint(avgbpm), beat, sample_set, sample_index, volume, False, effects)) break ms_control += (note_ms - ms_control) # print("ms_control:", ms_control) if i == hitobject.offset: continue result_object.HitObjects.append( convert.voidobject(hitobject.key_position, i)) last_note_offset = hitobject.offset else: continue break # どうやらコンソールのパスからの指定らしい... parser.parsesave(result_object, "export.txt")
from Relium import calcurate, export, classes, parser """ before_bpmからafter_bpmに変更されたときの緑線の倍率変更をします """ source_file = r"" parsed_file = parser.parsefile(source_file) before_bpm = 200 after_bpm = 250 export_timingpoint = list() for timingpoint in parsed_file.TimingPoints: if not timingpoint.inherited: continue export_timingpoint.append( classes.TimingPoint( timingpoint.offset, calcurate.inheritedpoint( calcurate.inheritedpoint(timingpoint.beat_length) * (after_bpm / before_bpm)), timingpoint.beat, timingpoint.sample_set, timingpoint.sample_index, timingpoint.volume, timingpoint.inherited, timingpoint.effects)) parser.parsesave(parser.ParsedBeatmap(export_timingpoint, list()), "./inheritedpoint.txt")