audiblelight.augmentation.Distortion

audiblelight.augmentation.Distortion#

class audiblelight.augmentation.Distortion(sample_rate=44100, drive_db=None)#

Bases: EventAugmentation

Applies distortion to the audio.

Applies a non-linear (tanh, or hyperbolic tangent) waveshaping function to apply harmonically pleasing distortion to a signal.

Parameters:
  • sample_rate (custom_types.Numeric) – the sample rate for the effect to use.

  • drive_db (int | float | complex | integer | floating | DistributionLike | None) – the dB level of the distortion effect. By default, will be sampled between 10 and 30 dB.

__init__(sample_rate=44100, drive_db=None)#
Parameters:
  • sample_rate (int | float | complex | integer | floating)

  • drive_db (int | float | complex | integer | floating | DistributionLike | None)

Methods

__init__([sample_rate, drive_db])

from_dict(input_dict)

Initialise an augmentation from a dictionary.

process(input_array)

Calls the underlying FX (or a list of FX)

sample_value(override, default_dist)

Samples a value according to the following method:

to_dict()

Returns the parameters used by this augmentation

Attributes

AUGMENTATION_TYPE

MAX_DRIVE

MIN_DRIVE

name

Returns the name of this augmentation

MAX_DRIVE = 30#
MIN_DRIVE = 10#