Compat issues

This commit is contained in:
Alexandre 2024-05-31 20:47:04 +02:00
parent c6fda9449d
commit 31639c850e
2 changed files with 3 additions and 3 deletions

View File

@ -9,14 +9,14 @@ def compare_plot():
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)
data = sound_process.process_song(beatmap.audio_filename, bpm, offset0=offset, n_iter_2=48, divisor=4)
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")
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)

View File

@ -498,7 +498,7 @@ def process_song(filename, bpm, offset0=0, div_len_factor=1, n_iter_2=-1, thresh
#void_freq(filename, offset, offset+div_len*(n_iter+1)+0.01, 4*60/bpm, minfreq=0, maxfreq=330, upperthr=2500, ampthr=60, ampfreq = 1200, ampval = 1/2000, leniency = 0.0, write=True, linear=True, output_file=filtered_name)
datares = filter_n_percent_serial(filtered_name, offset, n_iter, div_len, threshold)
#datares = snap(datares, 44100, bpm, 4, True)
datares = snap2(datares, 44100, bpm, first_offset=offset, div=4, show=True, adjust=True)
datares = snap2(datares, 44100, bpm, first_offset=offset, div=divisor, show=True, adjust=True)
frequencies = get_freq(filtered_name, offset, div_len, div_len*n_iter, datares, True)
Path(f"{filename}_trimmed.wav").unlink()
return convert_tuple(datares, frequencies)