Update main.py to work with new code
This commit is contained in:
parent
1453e1d639
commit
a567d0ef0d
5
main.py
5
main.py
|
@ -13,12 +13,11 @@ def main():
|
||||||
offset = timing.offset.total_seconds() * 1000
|
offset = timing.offset.total_seconds() * 1000
|
||||||
print(beatmap.audio_filename)
|
print(beatmap.audio_filename)
|
||||||
|
|
||||||
data = sound_process.process_song(beatmap.audio_filename, bpm, offset0=offset, n_iter_2=-1)
|
amplitudes, timings = sound_process.process_song(beatmap.audio_filename, bpm, offset0=offset, n_iter_2=-1)
|
||||||
# NOTE : remove n_iter_2 to map the whole music
|
# NOTE : remove n_iter_2 to map the whole music
|
||||||
timings, amplitudes, freqs = [x[0] for x in data], [x[1] for x in data], [x[2] for x in data]
|
timings = [timedelta(seconds=x) for x in timings]
|
||||||
|
|
||||||
beatmap._hit_objects = place.greedy(bpm, offset, timings, amplitudes)
|
beatmap._hit_objects = place.greedy(bpm, offset, timings, amplitudes)
|
||||||
beatmap.display_name = "TIPE's Extra"
|
|
||||||
#beatmap._hit_objects = [sl.Slider(sl.Position(0, 0), timedelta(milliseconds=3), timedelta(milliseconds=130), 0, sl.curve.Linear([sl.Position(0, 0), sl.Position(100, 100)], 100), 100, 2, 1, 1, 1, timing.ms_per_beat, [], [],)]
|
#beatmap._hit_objects = [sl.Slider(sl.Position(0, 0), timedelta(milliseconds=3), timedelta(milliseconds=130), 0, sl.curve.Linear([sl.Position(0, 0), sl.Position(100, 100)], 100), 100, 2, 1, 1, 1, timing.ms_per_beat, [], [],)]
|
||||||
beatmap.write_path("rewrite.osu")
|
beatmap.write_path("rewrite.osu")
|
||||||
|
|
||||||
|
|
|
@ -343,11 +343,13 @@ def process_song(filename, bpm, offset0=0, div_len_factor=1, n_iter_2=-1, thresh
|
||||||
|
|
||||||
datares = filter_n_percent_serial(filtered_name, offset, n_iter, div_len, threshold)
|
datares = filter_n_percent_serial(filtered_name, offset, n_iter, div_len, threshold)
|
||||||
|
|
||||||
|
#snapped_data = amplitude
|
||||||
|
#times in ms
|
||||||
(snapped_data, times) = debug.snap3(datares, mintime=50, initial_plot=True, after_plot=True)
|
(snapped_data, times) = debug.snap3(datares, mintime=50, initial_plot=True, after_plot=True)
|
||||||
|
|
||||||
#frequencies=get_freq(filtered_name, offset, div_len, div_len*n_iter, snapped_data, True)
|
#frequencies=get_freq(filtered_name, offset, div_len, div_len*n_iter, snapped_data, True)
|
||||||
Path(f"{filename}_trimmed.wav").unlink()
|
Path(f"{filename}_trimmed.wav").unlink()
|
||||||
return convert_tuple(snapped_data, times)
|
return snapped_data, times
|
||||||
|
|
||||||
'''
|
'''
|
||||||
datares = debug.snap2(datares, 44100, bpm, first_offset=offset, div=divisor, show=True, adjust=True)
|
datares = debug.snap2(datares, 44100, bpm, first_offset=offset, div=divisor, show=True, adjust=True)
|
||||||
|
|
Loading…
Reference in New Issue