예제 #1
0
effects = 0

## 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
]

i = int(target_start_offset)
result_object = classes.ParsedBeatmap([], [])
while (i <= target_end_offset):
    result_object.TimingPoints.append(
        classes.TimingPoint(i, 0.2, 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

    zero_break = False
    for count_ in range(6):
        result_object.TimingPoints.append(
            classes.TimingPoint(i, constant.zero_bpm, beat, sample_set,
                                sample_index, volume, False, effects))
        i += 1
예제 #2
0
파일: zero.py 프로젝트: Fairy-Phy/Relium
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: continue
    if target_hitobject.offset == target_start_offset:
        result_object.TimingPoints.append(
            classes.TimingPoint(target_start_offset, constant.zero_bpm, beat,
                                sample_set, sample_index, volume, False,
                                effects))
    elif target_hitobject.offset == target_end_offset:
        result_object.TimingPoints.append(
            classes.TimingPoint(target_hitobject.offset,
                                calcurate.timingpoint(avgbpm), beat,
                                sample_set, sample_index, volume, False,
                                effects))
    else:
        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,
예제 #3
0
min_scale = 0.01

min_step = 10
max_step = 1

beat = 4
sample_set = 2
sample_index = 0
volume = 100
effects = 0

## Main ##

# どうやらコンソールのパスからの指定らしい...
with open("./timingpoint.txt", mode='w') as exportfile:
	text: str = ""
	min_ok: bool = True
	i = start_offset
	while i <= end_offset:
		if min_ok:
			text += export.timingpoint(classes.TimingPoint(i, calcurate.inheritedpoint(min_scale), beat, sample_set, sample_index, volume, True, effects)) + "\n"
			min_ok = False
			i += min_step
		else:
			text += export.timingpoint(classes.TimingPoint(i, calcurate.inheritedpoint(max_scale), beat, sample_set, sample_index, volume, True, effects)) + "\n"
			min_ok = True
			i += max_step

	exportfile.write(text)
	pass
예제 #4
0
"""

start_offset = 100933
end_offset = 101068

bpm = 220
scale = 10.0

space = 2

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

## Main ##

bpmscale = bpm * scale

# どうやらコンソールのパスからの指定らしい...
with open("./timingpoint.txt", mode='w') as exportfile:
	text: str = ""
	i = start_offset
	while i <= end_offset:
		text += export.timingpoint(classes.TimingPoint(i, calcurate.timingpoint(bpmscale), beat, sample_set, sample_index, volume, False, effects)) + "\n"
		i += space

	exportfile.write(text)
	pass
예제 #5
0
		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")
예제 #6
0
# 低いほどすぐ下がる(上がる)
level = 2

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

## Main ##

# どうやらコンソールのパスからの指定らしい...
with open("./timingpoint1.txt", mode='w') as exportfile:
    text: str = ""

    for i in range(start_offset, end_offset + 1):
        scale_multiple = (i - start_offset) / (end_offset - start_offset)

        multipler = 1 - math.sqrt(1 - math.pow(scale_multiple, level))
        offset_scale = start_scale + multipler * (end_scale - start_scale)

        text += export.timingpoint(
            classes.TimingPoint(i, calcurate.inheritedpoint(offset_scale),
                                beat, sample_set, sample_index, volume, True,
                                effects)) + "\n"

        pass

    exportfile.write(text)
    pass
예제 #7
0
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: continue

    if mode == 0:
        if target_hitobject.offset == target_start_offset:
            result_object.TimingPoints.append(
                classes.TimingPoint(target_start_offset, constant.zero_bpm,
                                    beat, sample_set, sample_index, volume,
                                    False, effects))
        elif target_hitobject.offset == target_end_offset:
            result_object.TimingPoints.append(
                classes.TimingPoint(target_hitobject.offset - 1,
                                    calcurate.timingpoint(avgbpm * increase),
                                    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 - 1 if End_kiai else effects))
        else:
            result_object.TimingPoints.append(
                classes.TimingPoint(target_hitobject.offset - 1,
예제 #8
0
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")
예제 #9
0
beat = 4
sample_set = 1
sample_index = 0
volume = 100
effects = 0

## Main ##

# どうやらコンソールのパスからの指定らしい...
with open("./timingpoint.txt", mode='w') as exportfile:
    offset_bpm: float = (end_bpm - start_bpm) / (end_offset - start_offset)

    text: str = ""
    for i in range(start_offset, end_offset + 1, interval):
        if i == end_offset:
            text += export.timingpoint(
                classes.TimingPoint(i, calcurate.timingpoint(end_bpm), beat,
                                    sample_set, sample_index, volume, False,
                                    effects)) + "\n"
        else:
            text += export.timingpoint(
                classes.TimingPoint(
                    i,
                    calcurate.timingpoint((offset_bpm * (i - start_offset)) +
                                          start_bpm), beat, sample_set,
                    sample_index, volume, False, effects)) + "\n"

    exportfile.write(text)
    pass
예제 #10
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

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

    if mode == 0:
        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,