clarity.enhancer.multiband_compressor.multiband_compressor module

An implementation for Multiband Dynamic Range Compressor.

class clarity.enhancer.multiband_compressor.multiband_compressor.MultibandCompressor(crossover_frequencies: int | float | list | np.ndarray, sample_rate: float = 44100, compressors_params: dict | None = None)[source]

Bases: object

Multiband Compressor.

set_compressors(attack: list | float = 15.0, release: list | float = 100.0, threshold: list | float = 0.0, ratio: list | float = 1.0, makeup_gain: list | float = 0.0, knee_width: list | float = 0.0) None[source]

Set the compressors parameters.

Parameters can be a float or a list with the same length as center_frequencies.

Parameters:
  • attack (list | float) – The attack time in milliseconds.

  • release (list | float) – The release time in milliseconds.

  • threshold (list | float) – The threshold in dB.

  • ratio (list | float) – The ratio.

  • gain (list | float) – The make-up gain in dB.

  • knee_width (list | float) – The knee width in dB.

Returns:

The compressors.

Return type:

list[Compressor]

Raises:
  • ValueError – If the parameters are not the same length as

  • crossover frequencies + 1.