<reponame>Fairy-Phy/Relium
import random
from Relium import calcurate, classes, parser, constant

"""
1ラインづつランダムな位置に表示していきます
"""

source_file = r""

target_start_offset = 31999
target_end_offset = 34666

avgbpm = 180

# ノーツの高さの最大値(上げすぎると見えなくなります)
max_laneheight = 370

beat = 4
sample_set = 1
sample_index = 0
volume = 64
effects = 1

## Main ##

parsed_map = parser.parsefile(source_file)

target_hitobjects = [output for output in parsed_map.HitObjects if output.offset >= target_start_offset and output.offset <= target_end_offset]

last_process_offset = 0
result_object = classes.ParsedBeatmap([], [])
for target_hitobject in target_hitobjects:
	if target_hitobject.offset == last_process_offset:
		target_hitobjects.remove(target_hitobject)

	last_process_offset = target_hitobject.offset

for target_hitobject_i in range(len(target_hitobjects)):
	target_hitobject = target_hitobjects[target_hitobject_i]

	if target_hitobject_i == 0:
		result_object.TimingPoints.append(classes.TimingPoint(target_hitobject.offset, constant.inf_bpm, beat, sample_set, sample_index, volume, False, effects))
		result_object.TimingPoints.append(classes.TimingPoint(target_hitobject.offset + 1, constant.zero_bpm, beat, sample_set, sample_index, volume, False, effects))
	elif target_hitobject_i == len(target_hitobjects) - 1:
		if target_hitobject_i == 0:
			result_object.TimingPoints.append(classes.TimingPoint(target_hitobject.offset - 1, constant.zero_bpm, beat, sample_set, sample_index, volume, False, effects))
		else:
			result_object.TimingPoints.append(classes.TimingPoint(target_hitobject.offset - 1, calcurate.line_notesposition(avgbpm, random.uniform(1, 370)), beat, sample_set, sample_index, volume, False, effects))
		result_object.TimingPoints.append(classes.TimingPoint(target_hitobject.offset, calcurate.timingpoint(avgbpm), beat, sample_set, sample_index, volume, False, effects))
	else:
		if target_hitobject_i == 0:
			result_object.TimingPoints.append(classes.TimingPoint(target_hitobject.offset - 1, constant.zero_bpm, beat, sample_set, sample_index, volume, False, effects))
		else:
			result_object.TimingPoints.append(classes.TimingPoint(target_hitobject.offset - 1, calcurate.line_notesposition(avgbpm, random.uniform(1, 370)), beat, sample_set, sample_index, volume, False, effects))
		result_object.TimingPoints.append(classes.TimingPoint(target_hitobject.offset, constant.inf_bpm, beat, sample_set, sample_index, volume, False, effects))
		result_object.TimingPoints.append(classes.TimingPoint(target_hitobject.offset + 1, constant.zero_bpm, beat, sample_set, sample_index, volume, False, effects))

# どうやらコンソールのパスからの指定らしい...
parser.parsesave(result_object, "export.txt")

import random
from Relium import calcurate, classes, parser, constant

"""
1ラインづつランダムな位置に表示していきます
"""

source_file = r""

target_start_offset = 31999
target_end_offset = 34666

avgbpm = 180

# ノーツの高さの最大値(上げすぎると見えなくなります)
max_laneheight = 370

beat = 4
sample_set = 1
sample_index = 0
volume = 64
effects = 1

## Main ##

parsed_map = parser.parsefile(source_file)

target_hitobjects = [output for output in parsed_map.HitObjects if output.offset >= target_start_offset and output.offset <= target_end_offset]

last_process_offset = 0
result_object = classes.ParsedBeatmap([], [])
for target_hitobject in target_hitobjects:
	if target_hitobject.offset == last_process_offset:
		target_hitobjects.remove(target_hitobject)

	last_process_offset = target_hitobject.offset

for target_hitobject_i in range(len(target_hitobjects)):
	target_hitobject = target_hitobjects[target_hitobject_i]

	if target_hitobject_i == 0:
		result_object.TimingPoints.append(classes.TimingPoint(target_hitobject.offset, constant.inf_bpm, beat, sample_set, sample_index, volume, False, effects))
		result_object.TimingPoints.append(classes.TimingPoint(target_hitobject.offset + 1, constant.zero_bpm, beat, sample_set, sample_index, volume, False, effects))
	elif target_hitobject_i == len(target_hitobjects) - 1:
		if target_hitobject_i == 0:
			result_object.TimingPoints.append(classes.TimingPoint(target_hitobject.offset - 1, constant.zero_bpm, beat, sample_set, sample_index, volume, False, effects))
		else:
			result_object.TimingPoints.append(classes.TimingPoint(target_hitobject.offset - 1, calcurate.line_notesposition(avgbpm, random.uniform(1, 370)), beat, sample_set, sample_index, volume, False, effects))
		result_object.TimingPoints.append(classes.TimingPoint(target_hitobject.offset, calcurate.timingpoint(avgbpm), beat, sample_set, sample_index, volume, False, effects))
	else:
		if target_hitobject_i == 0:
			result_object.TimingPoints.append(classes.TimingPoint(target_hitobject.offset - 1, constant.zero_bpm, beat, sample_set, sample_index, volume, False, effects))
		else:
			result_object.TimingPoints.append(classes.TimingPoint(target_hitobject.offset - 1, calcurate.line_notesposition(avgbpm, random.uniform(1, 370)), beat, sample_set, sample_index, volume, False, effects))
		result_object.TimingPoints.append(classes.TimingPoint(target_hitobject.offset, constant.inf_bpm, beat, sample_set, sample_index, volume, False, effects))
		result_object.TimingPoints.append(classes.TimingPoint(target_hitobject.offset + 1, constant.zero_bpm, beat, sample_set, sample_index, volume, False, effects))

# どうやらコンソールのパスからの指定らしい...
parser.parsesave(result_object, "export.txt")
1ラインづつランダムな位置に表示していきます # ノーツの高さの最大値(上げすぎると見えなくなります) ## Main ## # どうやらコンソールのパスからの指定らしい...