feat: per-channel meters, ceiling lamp, and pre-gain drive

Stage 6 begins. Add lock-free Meters (atomics shared audio->GUI) with a
peak-with-decay ballistic, published once per block and gated on the editor
being open. Editor draws a per-channel level + gain-reduction meter panel and
a ceiling lamp fed by the output limiter. Compressor/Limiter expose
gain_reduction_db() for this.

Also add a smoothed per-channel pre-gain applied before each compressor (and
before the All compressor), driving the signal into compression and on into
the limiter for a compressed semi-distortion. Pairs with makeup for full
per-channel input/output gain-staging. Compressor DSP untouched; 16 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Mikkeli Matlock
2026-06-21 23:13:14 +09:00
parent 8c550da92e
commit a420d5dd39
6 changed files with 249 additions and 6 deletions
+7
View File
@@ -152,6 +152,13 @@ impl Compressor {
self.fixed_delay as u32
}
/// Current gain reduction being applied, in dB (>= 0), excluding makeup. For metering.
/// This is the smoothed detector output `yl`, so it tracks the visible needle, not the
/// instantaneous static curve.
pub fn gain_reduction_db(&self) -> f32 {
self.yl
}
/// Process one sample frame in place: `input[ch]` -> `output[ch]`.
///
/// `input` and `output` are short stack slices (one value per channel), so this