From 330a28cf9e2bba89a71639f24d0eda75f706e2d7 Mon Sep 17 00:00:00 2001
From: Sting <loic.allegre@ensiie.fr>
Date: Wed, 12 Jul 2023 17:06:18 +0200
Subject: [PATCH] More experiments

---
 cnn_madmom/segment.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/cnn_madmom/segment.py b/cnn_madmom/segment.py
index 1c49adc..fdab858 100644
--- a/cnn_madmom/segment.py
+++ b/cnn_madmom/segment.py
@@ -9,7 +9,7 @@ def segment(songfile):
 
     delay = -4
     smooth = 20
-    threshold = 0.4
+    threshold = 1
 
     cnn = madmom.features.onsets.CNNOnsetProcessor()
     #proc = madmom.features.onsets.OnsetPeakPickingProcessor(threshold=threshold, smooth=smooth, delay=delay, fps=100)
@@ -36,13 +36,15 @@ if __name__ == "__main__":
     activation_function = cnn(songfile, num_channels=1)
     #onsets = proc(activation_function)
 
-    onsets = madmom.features.onsets.peak_picking(activation_function, 0.4, smooth=20)
+    onsets = madmom.features.onsets.peak_picking(activation_function, threshold=1, smooth=20)
+    #onset_smoothed = madmom.audio.signal.smooth(activation_function, 20)
 
     print(onsets/100)
 
     fig, axs = plt.subplots(nrows=2, sharex=True)
     axs[0].imshow(log_spec.T, origin='lower', aspect='auto')
     axs[1].plot(activation_function)
+    #axs[1].plot(onset_smoothed, color='red')
     axs[1].vlines(onsets, 0, 1, colors='red')
 
     plt.show()
-- 
GitLab