Compare commits

...

5 Commits

Author SHA1 Message Date
Thibaud ac0e189b80 Merge branch 'freq-rhythm'
Add plotting to compare rhythm choice with original beatmap
2024-05-31 13:31:02 +02:00
Thibaud fb1a0dc027 Rename frequence_process to better reflect functionality 2024-05-31 13:30:44 +02:00
Thibaud 8955731742 Add n_iter in frequence_process.py... (still broken) 2024-05-30 20:45:53 +02:00
Thibaud acd0f68e4c Merge snapping fixes from main 2024-05-30 20:35:07 +02:00
Thibaud 3d727f3fec Add frequence_process plotting to compare original with detected 2024-05-29 16:35:33 +02:00
1 changed files with 29 additions and 0 deletions

29
compare_plot.py Normal file
View File

@ -0,0 +1,29 @@
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.total_seconds() * 1000
data = sound_process.process_song(beatmap.audio_filename, bpm, offset0=offset, n_iter_2=48)
timings, amplitudes, freqs = [x[0].total_seconds() for x in data], [x[1] for x in data], [x[2] for x in data]
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, amplitudes, marker="x", c="red")
for x in original_times:
plt.axvline(x=x)
plt.show()
def main():
compare_plot()
if __name__ == "__main__":
main()