Skip to content

parked for later: improve with ott tricks (mistral) #19

@huberp

Description

@huberp

OTT (and most commercial multiband/upwards compressors) avoids the "exploding peaks" issue through a combination of design choices and processing tricks. Here’s how OTT (and similar tools) typically handle upwards compression without causing distortion or excessive peak amplification:


1. Fast Release Time for Upwards Compression

  • OTT uses a very fast release time (often < 20 ms) for the upwards stage.
  • Why it works:
    • A fast release ensures the upwards gain decays quickly when the signal exceeds the threshold, preventing prolonged boosting of transients.
    • This is the simplest and most effective way to avoid overshoot.
  • Trade-off:
    • Too fast a release can make the compression sound "pumpy" or unnatural, but OTT’s default settings are tuned to balance smoothness and transient control.

2. Look-Ahead Processing

  • OTT uses a small look-ahead buffer (typically 1–5 ms) in its detector path.
  • Why it works:
    • The look-ahead allows the compressor to "see" incoming transients before they reach the gain stage, giving it time to reduce the upwards gain before the transient hits.
    • This is especially critical for upwards compression, where the gain can be very high after silence.
  • Trade-off:
    • Adds a small amount of latency (usually acceptable for mixing/mastering).

3. Dynamic Release or "Auto-Release" Logic

  • OTT’s release time is not static. It adapts based on the signal’s behavior:
    • If the signal rises quickly (e.g., a transient), the release time temporarily speeds up to avoid overshoot.
    • If the signal is steady (e.g., sustained notes), the release time stays slower for smoothness.
  • Why it works:
    • This balances transient control and smooth compression, reducing the chance of distorted peaks.
  • Trade-off:
    • More complex to implement, but the result is more transparent compression.

4. Limiting or Clipping the Upwards Gain

  • OTT caps the maximum upwards gain (e.g., +12 dB or +18 dB, depending on the band).
  • Why it works:
    • Even if the upwards stage "wants" to boost a signal by +30 dB (e.g., after silence), the gain is clipped to a reasonable maximum.
    • This prevents extreme amplification of noise or transients.
  • Trade-off:
    • Limits the effectiveness of upwards compression for very quiet signals, but this is rarely an issue in practice.

5. Noise Floor Handling

  • OTT clamps the input level to a noise floor (e.g., -60 dB or -70 dB) before calculating upwards gain.
  • Why it works:
    • Signals below the noise floor are not boosted, so the upwards gain doesn’t "wind up" during silence.
    • This is similar to the kUpwardFloorDb in your CompressorStage.h, but OTT’s floor is typically higher (e.g., -60 dB vs. -80 dB).
  • Trade-off:
    • Reduces the upwards compression effect on very quiet signals, but avoids amplifying noise or digital silence.

6. Per-Band Processing

  • OTT splits the signal into frequency bands (e.g., low, mid, high) and applies upwards compression independently per band.
  • Why it works:
    • A transient in one band (e.g., a kick drum in the lows) won’t cause the upwards stage in another band (e.g., highs) to "pump" unnecessarily.
    • This makes the compression sound more natural and reduces the chance of distorted peaks.
  • Trade-off:
    • More computationally intensive, but modern plugins handle this efficiently.

7. Smoothing and Ballistics

  • OTT uses carefully tuned ballistics (attack/release curves) that are not purely exponential.
  • Why it works:
    • The gain reduction/enhancement curves are designed to react quickly to transients but smoothly to steady-state signals.
    • This is often achieved with custom envelope followers or non-linear smoothing.
  • Trade-off:
    • Requires more DSP design effort, but the result is more transparent compression.

Key Takeaway: Why OTT Doesn’t "Explode" Your Signal

OTT avoids the issue you’re seeing because it:

  1. Uses a fast release time for upwards compression.
  2. Implements look-ahead to react to transients before they hit.
  3. Dynamically adjusts release time based on signal behavior.
  4. Caps the maximum upwards gain to prevent extreme boosting.
  5. Clamps the noise floor higher than -80 dB to avoid boosting silence.
  6. Processes bands independently to isolate transients.
  7. Uses custom ballistics for smoother, more natural gain changes.

What You Can Do in phu-compressor

To replicate OTT’s behavior:

  1. Reduce the upwards release time (e.g., set it to 10–20 ms).
  2. Add a look-ahead buffer (even 1–2 ms will help).
  3. Raise the noise floor (e.g., set kUpwardFloorDb to -60 dB).
  4. Cap the maximum upwards gain (e.g., +12 dB).
  5. Implement dynamic release (speed up release for fast-rising signals).

Example for dynamic release in CompressorStage.h:

// Detect fast-rising transients
const bool fastRise = (envDb - lastEnvDb[channel] > 6.0); // 6 dB jump = transient
const SampleType coeff = fastRise ? msToCoeff(10.0) : releaseCoeff; // 10 ms fast release
lastEnvDb[channel] = envDb; // Store for next sample

Final Answer

No, it’s not a misperception—OTT does avoid exploding peaks because of its fast release, look-ahead, dynamic release logic, gain capping, and per-band processing. Your compressor can achieve similar results by adopting these techniques, especially fast release times and look-ahead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions