asigalov61
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -55,6 +55,7 @@ def plot_ms_SONG(ms_song,
|
|
55 |
return_plt = False,
|
56 |
timings_multiplier=1,
|
57 |
plot_curve_values=None,
|
|
|
58 |
save_plot=''
|
59 |
):
|
60 |
|
@@ -87,18 +88,17 @@ def plot_ms_SONG(ms_song,
|
|
87 |
|
88 |
if plot_curve_values is not None:
|
89 |
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
ax.plot(x_smooth, y_smooth, color='white')
|
102 |
|
103 |
# Set the limits of the plot
|
104 |
ax.set_xlim([min(start_times), max(add_arrays(start_times, durations))])
|
|
|
55 |
return_plt = False,
|
56 |
timings_multiplier=1,
|
57 |
plot_curve_values=None,
|
58 |
+
plot_curve_notes_step=200
|
59 |
save_plot=''
|
60 |
):
|
61 |
|
|
|
88 |
|
89 |
if plot_curve_values is not None:
|
90 |
|
91 |
+
stimes = start_times[::plot_curve_notes_step]
|
92 |
+
|
93 |
+
min_val = min(plot_curve_values)
|
94 |
+
max_val = max(plot_curve_values)
|
95 |
+
spcva = [((value - min_val) / (max(max_val - min_val, 0.00001))) * 100 for value in plot_curve_values]
|
96 |
+
|
97 |
+
x = stimes
|
98 |
+
x_smooth = np.linspace(x.min(), x.max(), 300)
|
99 |
+
spl = make_interp_spline(x, spcva, k=9)
|
100 |
+
y_smooth = spl(x_smooth)
|
101 |
+
ax.plot(x_smooth, y_smooth, color='white')
|
|
|
102 |
|
103 |
# Set the limits of the plot
|
104 |
ax.set_xlim([min(start_times), max(add_arrays(start_times, durations))])
|