mattricesound commited on
Commit
5945136
1 Parent(s): 106ab10

Tune effects, replace models with asteroid, remove silence

Browse files
cfg/effects/all.yaml CHANGED
@@ -4,13 +4,19 @@ effects:
4
  chorus:
5
  _target_: remfx.effects.RandomPedalboardChorus
6
  sample_rate: ${sample_rate}
 
 
 
 
7
  min_depth: 0.2
8
- min_mix: 0.3
 
 
9
  distortion:
10
  _target_: remfx.effects.RandomPedalboardDistortion
11
  sample_rate: ${sample_rate}
12
- min_drive_db: 10
13
- max_drive_db: 50
14
  compressor:
15
  _target_: remfx.effects.RandomPedalboardCompressor
16
  sample_rate: ${sample_rate}
@@ -26,7 +32,7 @@ effects:
26
  min_damping: 0.2
27
  max_damping: 1.0
28
  min_wet_dry: 0.2
29
- max_wet_dry: 0.8
30
  min_width: 0.2
31
  max_width: 1.0
32
  delay:
@@ -35,6 +41,6 @@ effects:
35
  min_delay_seconds: 0.1
36
  max_delay_sconds: 1.0
37
  min_feedback: 0.05
38
- max_feedback: 0.6
39
- min_mix: 0.2
40
- max_mix: 0.7
 
4
  chorus:
5
  _target_: remfx.effects.RandomPedalboardChorus
6
  sample_rate: ${sample_rate}
7
+ min_rate_hz: 0.25
8
+ max_rate_hz: 1.5
9
+ min_feedback: 0.1
10
+ max_feedback: 0.4
11
  min_depth: 0.2
12
+ max_depth: 0.6
13
+ min_mix: 0.15
14
+ max_mix: 0.4
15
  distortion:
16
  _target_: remfx.effects.RandomPedalboardDistortion
17
  sample_rate: ${sample_rate}
18
+ min_drive_db: 7
19
+ max_drive_db: 25
20
  compressor:
21
  _target_: remfx.effects.RandomPedalboardCompressor
22
  sample_rate: ${sample_rate}
 
32
  min_damping: 0.2
33
  max_damping: 1.0
34
  min_wet_dry: 0.2
35
+ max_wet_dry: 0.6
36
  min_width: 0.2
37
  max_width: 1.0
38
  delay:
 
41
  min_delay_seconds: 0.1
42
  max_delay_sconds: 1.0
43
  min_feedback: 0.05
44
+ max_feedback: 0.3
45
+ min_mix: 0.1
46
+ max_mix: 0.35
cfg/exp/dist.yaml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # @package _global_
2
+ defaults:
3
+ - override /model: umx
4
+ - override /effects: all
5
+ seed: 12345
6
+ sample_rate: 48000
7
+ chunk_size: 262144 # 5.5s
8
+ logs_dir: "./logs"
9
+ render_files: True
10
+ render_root: "./data"
11
+ accelerator: "gpu"
12
+ log_audio: True
13
+ # Effects
14
+ max_kept_effects: 5
15
+ max_removed_effects: -1
16
+ shuffle_kept_effects: True
17
+ shuffle_removed_effects: False
18
+ num_classes: 5
19
+ effects_to_use:
20
+ - compressor
21
+ - distortion
22
+ - reverb
23
+ - chorus
24
+ - delay
25
+ effects_to_remove:
26
+ - distortion
27
+ datamodule:
28
+ batch_size: 16
29
+ num_workers: 8
cfg/model/dcunet.yaml CHANGED
@@ -9,16 +9,8 @@ model:
9
  sample_rate: ${sample_rate}
10
  network:
11
  _target_: remfx.models.DCUNetModel
12
- spec_dim: 257
13
- hidden_dim: 768
14
- filter_len: 512
15
- hop_len: 64
16
- block_layers: 4
17
- layers: 4
18
- kernel_size: 3
19
- refine_layers: 1
20
- is_mask: True
21
- norm: 'ins'
22
- act: 'comp'
23
  sample_rate: ${sample_rate}
24
  num_bins: 1025
 
9
  sample_rate: ${sample_rate}
10
  network:
11
  _target_: remfx.models.DCUNetModel
12
+ architecture: "DCUNet-10"
13
+ stft_kernel_size: 512
14
+ fix_length_mode: "pad"
 
 
 
 
 
 
 
 
15
  sample_rate: ${sample_rate}
16
  num_bins: 1025
cfg/model/dptnet.yaml CHANGED
@@ -9,12 +9,16 @@ model:
9
  sample_rate: ${sample_rate}
10
  network:
11
  _target_: remfx.models.DPTNetModel
12
- enc_dim: 256
13
- feature_dim: 64
14
- hidden_dim: 128
15
- layer: 6
16
- segment_size: 250
17
- nspk: 1
 
18
  win_len: 2
 
 
 
19
  sample_rate: ${sample_rate}
20
  num_bins: 1025
 
9
  sample_rate: ${sample_rate}
10
  network:
11
  _target_: remfx.models.DPTNetModel
12
+ n_src: 1
13
+ in_chan: 1
14
+ out_chan: 1
15
+ bn_chan: 128
16
+ hid_size: 128
17
+ chunk_size: 100
18
+ n_repeats: 6
19
  win_len: 2
20
+ fb_name: "free"
21
+ kernel_size: 16
22
+ n_filters: 1
23
  sample_rate: ${sample_rate}
24
  num_bins: 1025
remfx/models.py CHANGED
@@ -13,6 +13,7 @@ from remfx.dptnet import DPTNet_base
13
  from remfx.dcunet import RefineSpectrogramUnet
14
  from remfx.tcn import TCN
15
  from remfx.utils import causal_crop
 
16
 
17
 
18
  class RemFX(pl.LightningModule):
@@ -197,7 +198,7 @@ class DiffusionGenerationModel(nn.Module):
197
  class DPTNetModel(nn.Module):
198
  def __init__(self, sample_rate, num_bins, **kwargs):
199
  super().__init__()
200
- self.model = DPTNet_base(**kwargs)
201
  self.num_bins = num_bins
202
  self.mrstftloss = MultiResolutionSTFTLoss(
203
  n_bins=self.num_bins, sample_rate=sample_rate
@@ -217,7 +218,7 @@ class DPTNetModel(nn.Module):
217
  class DCUNetModel(nn.Module):
218
  def __init__(self, sample_rate, num_bins, **kwargs):
219
  super().__init__()
220
- self.model = RefineSpectrogramUnet(**kwargs)
221
  self.mrstftloss = MultiResolutionSTFTLoss(
222
  n_bins=num_bins, sample_rate=sample_rate
223
  )
@@ -225,7 +226,7 @@ class DCUNetModel(nn.Module):
225
 
226
  def forward(self, batch):
227
  x, target = batch
228
- output = self.model(x.squeeze(1)).unsqueeze(1) # B x 1 x T
229
  # Crop target to match output
230
  if output.shape[-1] < target.shape[-1]:
231
  target = causal_crop(target, output.shape[-1])
@@ -233,7 +234,7 @@ class DCUNetModel(nn.Module):
233
  return loss, output
234
 
235
  def sample(self, x: Tensor) -> Tensor:
236
- output = self.model(x.squeeze(1)).unsqueeze(1) # B x 1 x T
237
  return output
238
 
239
 
 
13
  from remfx.dcunet import RefineSpectrogramUnet
14
  from remfx.tcn import TCN
15
  from remfx.utils import causal_crop
16
+ import asteroid
17
 
18
 
19
  class RemFX(pl.LightningModule):
 
198
  class DPTNetModel(nn.Module):
199
  def __init__(self, sample_rate, num_bins, **kwargs):
200
  super().__init__()
201
+ self.model = asteroid.models.dptnet.DPTNet(**kwargs)
202
  self.num_bins = num_bins
203
  self.mrstftloss = MultiResolutionSTFTLoss(
204
  n_bins=self.num_bins, sample_rate=sample_rate
 
218
  class DCUNetModel(nn.Module):
219
  def __init__(self, sample_rate, num_bins, **kwargs):
220
  super().__init__()
221
+ self.model = asteroid.models.DCUNet(**kwargs)
222
  self.mrstftloss = MultiResolutionSTFTLoss(
223
  n_bins=num_bins, sample_rate=sample_rate
224
  )
 
226
 
227
  def forward(self, batch):
228
  x, target = batch
229
+ output = self.model(x.squeeze(1)) # B x 1 x T
230
  # Crop target to match output
231
  if output.shape[-1] < target.shape[-1]:
232
  target = causal_crop(target, output.shape[-1])
 
234
  return loss, output
235
 
236
  def sample(self, x: Tensor) -> Tensor:
237
+ output = self.model(x.squeeze(1)) # B x 1 x T
238
  return output
239
 
240
 
setup.py CHANGED
@@ -48,6 +48,7 @@ setup(
48
  "pedalboard",
49
  "frechet_audio_distance",
50
  "ordered-set",
 
51
  ],
52
  include_package_data=True,
53
  license="Apache License 2.0",
 
48
  "pedalboard",
49
  "frechet_audio_distance",
50
  "ordered-set",
51
+ "asteroid",
52
  ],
53
  include_package_data=True,
54
  license="Apache License 2.0",