Skip to content

Commit def2c6b

Browse files
jesseengelMagenta Team
authored andcommitted
Handle edge case of no notes detected.
PiperOrigin-RevId: 443217202
1 parent 761d6e3 commit def2c6b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

ddsp/training/postprocessing.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ def compute_dataset_statistics(data_provider,
309309
# Detect notes.
310310
mask_on, _ = detect_notes(loudness_trimmed, f0_conf_trimmed)
311311

312+
# If no notes detected, just default to using full signal.
313+
mask_on = np.logical_or(
314+
mask_on, np.logical_not(np.any(mask_on, axis=1, keepdims=True)))
315+
312316
quantile_transform = fit_quantile_transform(loudness_trimmed, mask_on)
313317

314318
# Pitch statistics.

ddsp/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
pulling in all the dependencies in __init__.py.
1919
"""
2020

21-
__version__ = '3.3.5'
21+
__version__ = '3.3.6'

0 commit comments

Comments
 (0)