- commit
- c08e77e563fbf015b65d6401765935611bd1cd16
- parent
- 39654f695db4ab1e5bc460d6b9ece71827742da1
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2025-03-06 10:51
rm unused code from analyze
Diffstat
| M | player.py | 10 | ++-------- |
1 files changed, 2 insertions, 8 deletions
diff --git a/player.py b/player.py
@@ -63,13 +63,7 @@ def timbre(y): 63 63 return numpy.linalg.inv(t) @ s 64 64 65 6566 -1 def analyze(y, sample_rate, beat_frames, bins_per_octave=12, n_octaves=7):67 -1 # cqt = librosa.cqt(y=y, sr=sample_rate)68 -1 # C = librosa.amplitude_to_db(cqt, ref=numpy.max)69 -1 # sync = librosa.util.sync(C, beat_frames)70 -1 # R_cqt = librosa.segment.recurrence_matrix(sync, width=4, mode='affinity')71 -1 # return (R_cqt + R_timbre) / 272 -1-1 66 def analyze(y, beat_frames): 73 67 tim = numpy.array([ 74 68 timbre(y[start:end]) for start, end in iter_beat_slices(beat_frames) 75 69 ]).T @@ -87,7 +81,7 @@ def load(filename, *, force=False): 87 81 print('Analyzing…') 88 82 y1, sample_rate1 = librosa.load(filename) 89 83 tempo, beat_frames = librosa.beat.beat_track(y=y1, sr=sample_rate1)90 -1 jumps = analyze(y1, sample_rate1, beat_frames)-1 84 jumps = analyze(y1, beat_frames) 91 85 92 86 with gzip.open(path_inf, 'wb') as fh: 93 87 pickle.dump((beat_frames, jumps), fh)