jhtonyKoo commited on
Commit
db9ab3b
1 Parent(s): 8889a57

modify fx norm

Browse files
Files changed (1) hide show
  1. inference.py +7 -7
inference.py CHANGED
@@ -165,7 +165,7 @@ class MasteringStyleTransfer:
165
  return "No parameters available"
166
 
167
  param_mapper = {
168
- 'EQ': {
169
  'low_shelf_gain_db': ('Low Shelf Gain', 'dB', -20, 20),
170
  'low_shelf_cutoff_freq': ('Low Shelf Cutoff', 'Hz', 20, 2000),
171
  'low_shelf_q_factor': ('Low Shelf Q', '', 0.1, 5.0),
@@ -185,11 +185,11 @@ class MasteringStyleTransfer:
185
  'high_shelf_cutoff_freq': ('High Shelf Cutoff', 'Hz', 4000, 20000), # Assuming sample_rate is 44100
186
  'high_shelf_q_factor': ('High Shelf Q', '', 0.1, 5.0),
187
  },
188
- 'DISTORTION': {
189
  'drive_db': ('Drive', 'dB', 0, 8),
190
  'parallel_weight_factor': ('Dry/Wet Mix', '%', 0, 100),
191
  },
192
- 'MULTIBAND_COMP': {
193
  'low_cutoff': ('Low/Mid Crossover', 'Hz', 20, 1000),
194
  'high_cutoff': ('Mid/High Crossover', 'Hz', 1000, 20000),
195
  'parallel_weight_factor': ('Dry/Wet Mix', '%', 0, 100),
@@ -212,13 +212,13 @@ class MasteringStyleTransfer:
212
  'high_shelf_at': ('High Band Attack Time', 'ms', 5, 100),
213
  'high_shelf_rt': ('High Band Release Time', 'ms', 5, 100),
214
  },
215
- 'GAIN': {
216
  'gain_db': ('Output Gain', 'dB', -24, 24),
217
  },
218
- 'IMAGER': {
219
  'width': ('Stereo Width', '', 0, 1),
220
  },
221
- 'LIMITER': {
222
  'threshold': ('Threshold', 'dB', -60, 0),
223
  'at': ('Attack Time', 'ms', 5, 100),
224
  'rt': ('Release Time', 'ms', 5, 100),
@@ -227,7 +227,7 @@ class MasteringStyleTransfer:
227
 
228
  output = []
229
  for fx_name, fx_params in params.items():
230
- output.append(f"{fx_name}:")
231
  if isinstance(fx_params, dict):
232
  for param_name, param_value in fx_params.items():
233
  if isinstance(param_value, torch.Tensor):
 
165
  return "No parameters available"
166
 
167
  param_mapper = {
168
+ 'eq': {
169
  'low_shelf_gain_db': ('Low Shelf Gain', 'dB', -20, 20),
170
  'low_shelf_cutoff_freq': ('Low Shelf Cutoff', 'Hz', 20, 2000),
171
  'low_shelf_q_factor': ('Low Shelf Q', '', 0.1, 5.0),
 
185
  'high_shelf_cutoff_freq': ('High Shelf Cutoff', 'Hz', 4000, 20000), # Assuming sample_rate is 44100
186
  'high_shelf_q_factor': ('High Shelf Q', '', 0.1, 5.0),
187
  },
188
+ 'distortion': {
189
  'drive_db': ('Drive', 'dB', 0, 8),
190
  'parallel_weight_factor': ('Dry/Wet Mix', '%', 0, 100),
191
  },
192
+ 'multiband_comp': {
193
  'low_cutoff': ('Low/Mid Crossover', 'Hz', 20, 1000),
194
  'high_cutoff': ('Mid/High Crossover', 'Hz', 1000, 20000),
195
  'parallel_weight_factor': ('Dry/Wet Mix', '%', 0, 100),
 
212
  'high_shelf_at': ('High Band Attack Time', 'ms', 5, 100),
213
  'high_shelf_rt': ('High Band Release Time', 'ms', 5, 100),
214
  },
215
+ 'gain': {
216
  'gain_db': ('Output Gain', 'dB', -24, 24),
217
  },
218
+ 'imager': {
219
  'width': ('Stereo Width', '', 0, 1),
220
  },
221
+ 'limiter': {
222
  'threshold': ('Threshold', 'dB', -60, 0),
223
  'at': ('Attack Time', 'ms', 5, 100),
224
  'rt': ('Release Time', 'ms', 5, 100),
 
227
 
228
  output = []
229
  for fx_name, fx_params in params.items():
230
+ output.append(f"{fx_name.upper()}:")
231
  if isinstance(fx_params, dict):
232
  for param_name, param_value in fx_params.items():
233
  if isinstance(param_value, torch.Tensor):