Spaces:
Sleeping
Sleeping
Commit
·
4a7a6b8
1
Parent(s):
f6e5f6d
Randomize train and val effects the same, drop audio that is too short
Browse files- cfg/config.yaml +7 -6
- cfg/effects/all.yaml +29 -68
- cfg/effects/chorus.yaml +5 -18
- cfg/effects/compression.yaml +0 -22
- cfg/effects/compressor.yaml +9 -0
- cfg/effects/distortion.yaml +5 -12
- cfg/effects/reverb.yaml +11 -24
- cfg/exp/{demucs_compression.yaml → demucs_compressor.yaml} +1 -1
- cfg/exp/{umx_compression.yaml → umx_compressor} +0 -0
- remfx/datasets.py +2 -4
cfg/config.yaml
CHANGED
|
@@ -6,6 +6,7 @@ defaults:
|
|
| 6 |
seed: 12345
|
| 7 |
train: True
|
| 8 |
sample_rate: 48000
|
|
|
|
| 9 |
logs_dir: "./logs"
|
| 10 |
log_every_n_steps: 1000
|
| 11 |
render_files: True
|
|
@@ -28,27 +29,27 @@ datamodule:
|
|
| 28 |
_target_: remfx.datasets.VocalSet
|
| 29 |
sample_rate: ${sample_rate}
|
| 30 |
root: ${oc.env:DATASET_ROOT}
|
| 31 |
-
|
| 32 |
mode: "train"
|
| 33 |
-
effect_types: ${effects
|
| 34 |
render_files: ${render_files}
|
| 35 |
render_root: ${render_root}
|
| 36 |
val_dataset:
|
| 37 |
_target_: remfx.datasets.VocalSet
|
| 38 |
sample_rate: ${sample_rate}
|
| 39 |
root: ${oc.env:DATASET_ROOT}
|
| 40 |
-
|
| 41 |
mode: "val"
|
| 42 |
-
effect_types: ${effects
|
| 43 |
render_files: ${render_files}
|
| 44 |
render_root: ${render_root}
|
| 45 |
test_dataset:
|
| 46 |
_target_: remfx.datasets.VocalSet
|
| 47 |
sample_rate: ${sample_rate}
|
| 48 |
root: ${oc.env:DATASET_ROOT}
|
| 49 |
-
|
| 50 |
mode: "test"
|
| 51 |
-
effect_types: ${effects
|
| 52 |
render_files: ${render_files}
|
| 53 |
render_root: ${render_root}
|
| 54 |
|
|
|
|
| 6 |
seed: 12345
|
| 7 |
train: True
|
| 8 |
sample_rate: 48000
|
| 9 |
+
chunk_size: 262144 # 5.5s
|
| 10 |
logs_dir: "./logs"
|
| 11 |
log_every_n_steps: 1000
|
| 12 |
render_files: True
|
|
|
|
| 29 |
_target_: remfx.datasets.VocalSet
|
| 30 |
sample_rate: ${sample_rate}
|
| 31 |
root: ${oc.env:DATASET_ROOT}
|
| 32 |
+
chunk_size: ${chunk_size}
|
| 33 |
mode: "train"
|
| 34 |
+
effect_types: ${effects}
|
| 35 |
render_files: ${render_files}
|
| 36 |
render_root: ${render_root}
|
| 37 |
val_dataset:
|
| 38 |
_target_: remfx.datasets.VocalSet
|
| 39 |
sample_rate: ${sample_rate}
|
| 40 |
root: ${oc.env:DATASET_ROOT}
|
| 41 |
+
chunk_size: ${chunk_size}
|
| 42 |
mode: "val"
|
| 43 |
+
effect_types: ${effects}
|
| 44 |
render_files: ${render_files}
|
| 45 |
render_root: ${render_root}
|
| 46 |
test_dataset:
|
| 47 |
_target_: remfx.datasets.VocalSet
|
| 48 |
sample_rate: ${sample_rate}
|
| 49 |
root: ${oc.env:DATASET_ROOT}
|
| 50 |
+
chunk_size: ${chunk_size}
|
| 51 |
mode: "test"
|
| 52 |
+
effect_types: ${effects}
|
| 53 |
render_files: ${render_files}
|
| 54 |
render_root: ${render_root}
|
| 55 |
|
cfg/effects/all.yaml
CHANGED
|
@@ -1,70 +1,31 @@
|
|
| 1 |
# @package _global_
|
| 2 |
effects:
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
_target_: remfx.effects.RandomPedalboardChorus
|
| 33 |
-
sample_rate: ${sample_rate}
|
| 34 |
-
min_rate_hz: 1.0
|
| 35 |
-
max_rate_hz: 1.0
|
| 36 |
-
min_depth: 0.3
|
| 37 |
-
max_depth: 0.3
|
| 38 |
-
min_centre_delay_ms: 7.5
|
| 39 |
-
max_centre_delay_ms: 7.5
|
| 40 |
-
min_feedback: 0.4
|
| 41 |
-
max_feedback: 0.4
|
| 42 |
-
min_mix: 0.4
|
| 43 |
-
max_mix: 0.4
|
| 44 |
-
Distortion:
|
| 45 |
-
_target_: remfx.effects.RandomPedalboardDistortion
|
| 46 |
-
sample_rate: ${sample_rate}
|
| 47 |
-
min_drive_db: 30
|
| 48 |
-
max_drive_db: 30
|
| 49 |
-
Compressor:
|
| 50 |
-
_target_: remfx.effects.RandomPedalboardCompressor
|
| 51 |
-
sample_rate: ${sample_rate}
|
| 52 |
-
min_threshold_db: -32
|
| 53 |
-
max_threshold_db: -32
|
| 54 |
-
min_ratio: 3.0
|
| 55 |
-
max_ratio: 3.0
|
| 56 |
-
min_attack_ms: 10.0
|
| 57 |
-
max_attack_ms: 10.0
|
| 58 |
-
min_release_ms: 40.0
|
| 59 |
-
max_release_ms: 40.0
|
| 60 |
-
Reverb:
|
| 61 |
-
_target_: remfx.effects.RandomPedalboardReverb
|
| 62 |
-
sample_rate: ${sample_rate}
|
| 63 |
-
min_room_size: 0.5
|
| 64 |
-
max_room_size: 0.5
|
| 65 |
-
min_damping: 0.5
|
| 66 |
-
max_damping: 0.5
|
| 67 |
-
min_wet_dry: 0.4
|
| 68 |
-
max_wet_dry: 0.4
|
| 69 |
-
min_width: 0.5
|
| 70 |
-
max_width: 0.5
|
|
|
|
| 1 |
# @package _global_
|
| 2 |
effects:
|
| 3 |
+
Chorus:
|
| 4 |
+
_target_: remfx.effects.RandomPedalboardChorus
|
| 5 |
+
sample_rate: ${sample_rate}
|
| 6 |
+
min_depth: 0.2
|
| 7 |
+
min_mix: 0.3
|
| 8 |
+
Distortion:
|
| 9 |
+
_target_: remfx.effects.RandomPedalboardDistortion
|
| 10 |
+
sample_rate: ${sample_rate}
|
| 11 |
+
min_drive_db: 10
|
| 12 |
+
max_drive_db: 50
|
| 13 |
+
Compressor:
|
| 14 |
+
_target_: remfx.effects.RandomPedalboardCompressor
|
| 15 |
+
sample_rate: ${sample_rate}
|
| 16 |
+
min_threshold_db: -42.0
|
| 17 |
+
max_threshold_db: -20.0
|
| 18 |
+
min_ratio: 1.5
|
| 19 |
+
max_ratio: 6.0
|
| 20 |
+
Reverb:
|
| 21 |
+
_target_: remfx.effects.RandomPedalboardReverb
|
| 22 |
+
sample_rate: ${sample_rate}
|
| 23 |
+
min_room_size: 0.3
|
| 24 |
+
max_room_size: 1.0
|
| 25 |
+
min_damping: 0.2
|
| 26 |
+
max_damping: 1.0
|
| 27 |
+
min_wet_dry: 0.2
|
| 28 |
+
max_wet_dry: 0.8
|
| 29 |
+
min_width: 0.2
|
| 30 |
+
max_width: 1.0
|
| 31 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cfg/effects/chorus.yaml
CHANGED
|
@@ -1,20 +1,7 @@
|
|
| 1 |
# @package _global_
|
| 2 |
effects:
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
Chorus:
|
| 9 |
-
_target_: remfx.effects.RandomPedalboardChorus
|
| 10 |
-
sample_rate: ${sample_rate}
|
| 11 |
-
min_rate_hz: 1.0
|
| 12 |
-
max_rate_hz: 1.0
|
| 13 |
-
min_depth: 0.3
|
| 14 |
-
max_depth: 0.3
|
| 15 |
-
min_centre_delay_ms: 7.5
|
| 16 |
-
max_centre_delay_ms: 7.5
|
| 17 |
-
min_feedback: 0.4
|
| 18 |
-
max_feedback: 0.4
|
| 19 |
-
min_mix: 0.4
|
| 20 |
-
max_mix: 0.4
|
|
|
|
| 1 |
# @package _global_
|
| 2 |
effects:
|
| 3 |
+
Chorus:
|
| 4 |
+
_target_: remfx.effects.RandomPedalboardChorus
|
| 5 |
+
sample_rate: ${sample_rate}
|
| 6 |
+
min_depth: 0.2
|
| 7 |
+
min_mix: 0.3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cfg/effects/compression.yaml
DELETED
|
@@ -1,22 +0,0 @@
|
|
| 1 |
-
# @package _global_
|
| 2 |
-
effects:
|
| 3 |
-
train_effects:
|
| 4 |
-
Compressor:
|
| 5 |
-
_target_: remfx.effects.RandomPedalboardCompressor
|
| 6 |
-
sample_rate: ${sample_rate}
|
| 7 |
-
min_threshold_db: -42.0
|
| 8 |
-
max_threshold_db: -20.0
|
| 9 |
-
min_ratio: 1.5
|
| 10 |
-
max_ratio: 6.0
|
| 11 |
-
val_effects:
|
| 12 |
-
Compressor:
|
| 13 |
-
_target_: remfx.effects.RandomPedalboardCompressor
|
| 14 |
-
sample_rate: ${sample_rate}
|
| 15 |
-
min_threshold_db: -32
|
| 16 |
-
max_threshold_db: -32
|
| 17 |
-
min_ratio: 3.0
|
| 18 |
-
max_ratio: 3.0
|
| 19 |
-
min_attack_ms: 10.0
|
| 20 |
-
max_attack_ms: 10.0
|
| 21 |
-
min_release_ms: 40.0
|
| 22 |
-
max_release_ms: 40.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cfg/effects/compressor.yaml
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# @package _global_
|
| 2 |
+
effects:
|
| 3 |
+
Compressor:
|
| 4 |
+
_target_: remfx.effects.RandomPedalboardCompressor
|
| 5 |
+
sample_rate: ${sample_rate}
|
| 6 |
+
min_threshold_db: -42.0
|
| 7 |
+
max_threshold_db: -20.0
|
| 8 |
+
min_ratio: 1.5
|
| 9 |
+
max_ratio: 6.0
|
cfg/effects/distortion.yaml
CHANGED
|
@@ -1,14 +1,7 @@
|
|
| 1 |
# @package _global_
|
| 2 |
effects:
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
max_drive_db: 50
|
| 9 |
-
val_effects:
|
| 10 |
-
Distortion:
|
| 11 |
-
_target_: remfx.effects.RandomPedalboardDistortion
|
| 12 |
-
sample_rate: ${sample_rate}
|
| 13 |
-
min_drive_db: 30
|
| 14 |
-
max_drive_db: 30
|
|
|
|
| 1 |
# @package _global_
|
| 2 |
effects:
|
| 3 |
+
Distortion:
|
| 4 |
+
_target_: remfx.effects.RandomPedalboardDistortion
|
| 5 |
+
sample_rate: ${sample_rate}
|
| 6 |
+
min_drive_db: 10
|
| 7 |
+
max_drive_db: 50
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cfg/effects/reverb.yaml
CHANGED
|
@@ -1,26 +1,13 @@
|
|
| 1 |
# @package _global_
|
| 2 |
effects:
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
max_width: 1.0
|
| 15 |
-
val_effects:
|
| 16 |
-
Reverb:
|
| 17 |
-
_target_: remfx.effects.RandomPedalboardReverb
|
| 18 |
-
sample_rate: ${sample_rate}
|
| 19 |
-
min_room_size: 0.5
|
| 20 |
-
max_room_size: 0.5
|
| 21 |
-
min_damping: 0.5
|
| 22 |
-
max_damping: 0.5
|
| 23 |
-
min_wet_dry: 0.4
|
| 24 |
-
max_wet_dry: 0.4
|
| 25 |
-
min_width: 0.5
|
| 26 |
-
max_width: 0.5
|
|
|
|
| 1 |
# @package _global_
|
| 2 |
effects:
|
| 3 |
+
Reverb:
|
| 4 |
+
_target_: remfx.effects.RandomPedalboardReverb
|
| 5 |
+
sample_rate: ${sample_rate}
|
| 6 |
+
min_room_size: 0.3
|
| 7 |
+
max_room_size: 1.0
|
| 8 |
+
min_damping: 0.2
|
| 9 |
+
max_damping: 1.0
|
| 10 |
+
min_wet_dry: 0.2
|
| 11 |
+
max_wet_dry: 0.8
|
| 12 |
+
min_width: 0.2
|
| 13 |
+
max_width: 1.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cfg/exp/{demucs_compression.yaml → demucs_compressor.yaml}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
# @package _global_
|
| 2 |
defaults:
|
| 3 |
- override /model: demucs
|
| 4 |
-
- override /effects:
|
|
|
|
| 1 |
# @package _global_
|
| 2 |
defaults:
|
| 3 |
- override /model: demucs
|
| 4 |
+
- override /effects: compressor
|
cfg/exp/{umx_compression.yaml → umx_compressor}
RENAMED
|
File without changes
|
remfx/datasets.py
CHANGED
|
@@ -55,10 +55,8 @@ class VocalSet(Dataset):
|
|
| 55 |
)
|
| 56 |
chunk_size_in_samples = self.chunk_size_in_sec * self.sample_rate
|
| 57 |
if resampled_chunk.shape[-1] < chunk_size_in_samples:
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
(0, chunk_size_in_samples - resampled_chunk.shape[1]),
|
| 61 |
-
)
|
| 62 |
# Apply effect
|
| 63 |
effect_idx = torch.rand(1).item() * len(self.effect_types.keys())
|
| 64 |
effect_name = list(self.effect_types.keys())[int(effect_idx)]
|
|
|
|
| 55 |
)
|
| 56 |
chunk_size_in_samples = self.chunk_size_in_sec * self.sample_rate
|
| 57 |
if resampled_chunk.shape[-1] < chunk_size_in_samples:
|
| 58 |
+
# Skip if chunk is too small
|
| 59 |
+
continue
|
|
|
|
|
|
|
| 60 |
# Apply effect
|
| 61 |
effect_idx = torch.rand(1).item() * len(self.effect_types.keys())
|
| 62 |
effect_name = list(self.effect_types.keys())[int(effect_idx)]
|