Commit
·
c1e4dcd
1
Parent(s):
dff7eea
reverting loudness matching for /generate
Browse files- one_shot_generation.py +9 -11
one_shot_generation.py
CHANGED
@@ -112,21 +112,17 @@ def generate_loop_continuation_with_mrt(
|
|
112 |
# Final exact-length trim to requested bars
|
113 |
out = hard_trim_seconds(stitched, total_secs)
|
114 |
|
115 |
-
#
|
|
|
116 |
apply_micro_fades(out, 5)
|
117 |
|
118 |
-
#
|
119 |
-
out, loud_stats =
|
120 |
-
out,
|
121 |
-
|
122 |
-
bpm=bpm,
|
123 |
-
beats_per_bar=beats_per_bar,
|
124 |
-
method=loudness_mode,
|
125 |
-
headroom_db=loudness_headroom_db,
|
126 |
)
|
127 |
|
128 |
-
|
129 |
-
out = out.peak_normalize(0.95)
|
130 |
|
131 |
|
132 |
def generate_style_only_with_mrt(
|
@@ -236,6 +232,8 @@ def apply_barwise_loudness_match(
|
|
236 |
reps = int(np.ceil(need / float(ref.shape[0]))) if ref.shape[0] else 1
|
237 |
ref_tiled = np.tile(ref, (max(1, reps), 1))[:need]
|
238 |
|
|
|
|
|
239 |
gains_db = []
|
240 |
out_adj = y.copy()
|
241 |
n_bars = max(1, int(np.ceil(need / float(bar_len))))
|
|
|
112 |
# Final exact-length trim to requested bars
|
113 |
out = hard_trim_seconds(stitched, total_secs)
|
114 |
|
115 |
+
# Final polish AFTER drop
|
116 |
+
out = out.peak_normalize(0.95)
|
117 |
apply_micro_fades(out, 5)
|
118 |
|
119 |
+
# Loudness match to input (after drop) so bar 1 sits right
|
120 |
+
out, loud_stats = match_loudness_to_reference(
|
121 |
+
ref=loop, target=out,
|
122 |
+
method=loudness_mode, headroom_db=loudness_headroom_db
|
|
|
|
|
|
|
|
|
123 |
)
|
124 |
|
125 |
+
return out, loud_stats
|
|
|
126 |
|
127 |
|
128 |
def generate_style_only_with_mrt(
|
|
|
232 |
reps = int(np.ceil(need / float(ref.shape[0]))) if ref.shape[0] else 1
|
233 |
ref_tiled = np.tile(ref, (max(1, reps), 1))[:need]
|
234 |
|
235 |
+
from .utils import match_loudness_to_reference # same module in your tree
|
236 |
+
|
237 |
gains_db = []
|
238 |
out_adj = y.copy()
|
239 |
n_bars = max(1, int(np.ceil(need / float(bar_len))))
|