15 releases

0.2.12-alpha.0 Apr 7, 2023
0.2.11-alpha.0 Dec 19, 2022
0.2.5-alpha.0 Jun 21, 2022
0.2.4-alpha.0 Mar 14, 2022
0.1.42-alpha.0 Oct 27, 2021

#11 in #surge

Download history 10/week @ 2024-03-10 2/week @ 2024-03-17 11/week @ 2024-03-31 3/week @ 2024-04-07 1/week @ 2024-04-14 4/week @ 2024-04-21 1/week @ 2024-04-28 4/week @ 2024-05-19 5/week @ 2024-05-26 350/week @ 2024-06-09 16/week @ 2024-06-16 2/week @ 2024-06-23

369 downloads per month
Used in 3 crates (2 directly)

GPL-3.0 license

750KB
13K SLoC

Audio conditioner effect for the Surge synthesizer

The surgefx-conditioner crate provides an audio conditioner effect as a subcomponent of the Surge synthesizer system. The conditioner effect helps improve the overall sound quality and dynamics of the audio signal by applying various processing techniques such as equalization, compression, and limiting.

The main struct provided by this crate is Conditioner, which is responsible for the processing and management of the conditioner effect. The Conditioner struct has several methods and fields related to its operation, including:

  • control_group
  • control_type
  • default_value
  • max_value
  • min_value
  • modulateable
  • moverate
  • value_type
  • update
  • update_bands
  • ConditionerProcessCfg
  • do_conditioner_block
  • increment_bufpos
  • update_delayed
  • update_filtered_lamax
  • update_gain
  • update_lamax
  • do_lookahead
  • get_lookahead
  • conditioner_smoke
  • init
  • process
  • process_bands
  • process_mid_side
  • process_only_control
  • process_postamp
  • set_vu01
  • set_vu45
  • update_amp

The conditioner effect applies several mathematical operations to the input audio signal, including filtering, gain adjustments, and dynamics processing. These operations involve mathematical equations such as transfer functions, frequency-domain transformations, and time-domain processing. The specific equations used depend on the implementation details and chosen processing techniques.

Some key mathematical concepts involved in the conditioner effect include:

  1. Equalization: Applying frequency-domain filtering to modify the amplitude response of the audio signal at specific frequency bands. This can involve operations such as convolution or multiplication in the frequency domain.

  2. Compression: Reducing the dynamic range of the audio signal by attenuating the amplitude of signals above a specified threshold. This process typically involves calculating a gain reduction factor based on the input signal's amplitude and a user-defined ratio.

  3. Limiting: Preventing the audio signal from exceeding a specified amplitude threshold by applying a hard limit on its peaks. This process can be seen as an extreme form of compression with a high ratio and fast attack/release times.

By combining these processing techniques, the surgefx-conditioner crate helps enhance the sound quality and dynamics of the audio signal, making it suitable for use within the Surge synthesizer system.

Keep in mind that this description assumes a typical audio conditioner effect based on the provided tokens. The actual functionality of your specific implementation might vary, so please adjust the description as needed to accurately reflect your implementation.

14> could you teach me how a conditioner works? what about a detailed block diagram? are there any useful variants?

A conditioner is an audio processing unit designed to improve the overall sound quality and dynamics of an audio signal. It typically consists of several stages, such as equalization, compression, and limiting, which work together to enhance the audio signal's tonal balance and dynamic range. Here's a detailed block diagram of a typical audio conditioner:

  1. Input Signal: The audio signal that you want to process with the conditioner.

  2. Equalization: This stage applies frequency-domain filtering to modify the amplitude response of the audio signal at specific frequency bands. Equalization can be achieved using various filter types (e.g., low-pass, high-pass, band-pass, notch, etc.) and can either boost or cut the signal's amplitude at the desired frequencies.

  3. Compression: This stage reduces the dynamic range of the audio signal by attenuating the amplitude of signals above a specified threshold. Compression helps to control the signal's peaks, making the overall sound more consistent and balanced. A compressor typically has user-adjustable parameters such as threshold, ratio, attack, and release times, which determine the amount and character of the compression applied.

  4. Limiting: This stage prevents the audio signal from exceeding a specified amplitude threshold by applying a hard limit on its peaks. A limiter can be seen as an extreme form of compression with a high ratio and fast attack/release times. Limiting is often used to prevent clipping and distortion in the output signal, especially when used in a mastering context.

  5. Output Signal: The processed audio signal, which has been equalized, compressed, and limited to improve its overall sound quality and dynamics.

There are several useful variants of audio conditioners, some of which may include additional processing stages or focus on specific aspects of the conditioning process:

  1. Multiband Conditioner: This type of conditioner splits the input signal into multiple frequency bands and applies separate equalization, compression, and limiting to each band. This approach provides more precise control over the conditioning process and can yield better results, especially when dealing with complex or problematic audio signals.

  2. Dynamic Equalizer: A dynamic equalizer combines the functionality of an equalizer and a compressor, adjusting the equalization settings based on the input signal's amplitude. This type of conditioner can provide more transparent and natural-sounding results compared to traditional equalizers and compressors.

  3. Stereo Conditioner: A stereo conditioner processes the left and right channels of a stereo signal separately or jointly, depending on the desired effect. This type of conditioner can enhance the stereo image and provide more control over the spatial aspects of the audio signal.

  4. Mid-Side Conditioner: This variant processes the mid (sum of left and right) and side (difference between left and right) components of a stereo signal separately, allowing for precise control over the stereo width and balance. Mid-side conditioning can be particularly useful for mastering applications, where maintaining a balanced and well-defined stereo image is crucial.

These variants and others can be tailored to specific applications or combined to create more versatile and powerful audio conditioning solutions.

Dependencies

~11–21MB
~298K SLoC