29 lines
912 B
Python
29 lines
912 B
Python
import slider as sl
|
|
import sound_process
|
|
from tkinter import filedialog as fd
|
|
from matplotlib import pyplot as plt
|
|
|
|
def compare_plot():
|
|
filename = fd.askopenfilename()
|
|
beatmap = sl.Beatmap.from_path(filename)
|
|
timing = beatmap.timing_points[0]
|
|
bpm = timing.bpm
|
|
offset = timing.offset
|
|
timings, amplitudes = sound_process.process_song(beatmap.audio_filename, bpm, offset=offset, n_iter_2=-1)
|
|
timings = [x.total_seconds() for x in timings]
|
|
|
|
original_times = [x.time.total_seconds() for x in beatmap.hit_objects(spinners=False) if x.time.total_seconds() <= timings[len(timings) - 1]]
|
|
|
|
#bx.scatter(original_times, ys=10, zs=0)
|
|
plt.scatter(timings, [1 if amplitudes[i] > 1000 else 0 for i in range(len(amplitudes))], marker="x", c="red")
|
|
for x in original_times:
|
|
plt.axvline(x=x)
|
|
|
|
plt.show()
|
|
|
|
def main():
|
|
compare_plot()
|
|
|
|
if __name__ == "__main__":
|
|
main()
|