Open oreillyp opened 3 months ago
It also looks like the parameter name within the module does not match the distortion function signature -- it should be drive_db
. The following fixes both errors:
class Distortion(Processor):
def __init__(
self,
sample_rate: int = None,
min_drive_db: float = 0.0,
max_drive_db: float = 24.0,
):
super().__init__()
self.sample_rate = sample_rate
self.process_fn = distortion
self.param_ranges = {
"drive_db": (min_drive_db, max_drive_db),
}
self.num_params = len(self.param_ranges)
Because the
Distortion
module does not have asample_rate
attribute, calling.process_normalized()
fails:One solution would be to add a
sample_rate
attribute, even if it is a no-op; another would be to store a default sample rate ofNone
in theProcessor
class to support modules that do not require a sample rate.