feat: live operating-point fill + -6 dB refs on the gain curve
Add a per-channel input_level meter (post pre-gain, peak-with-decay) and use it to shade the gain curve: a translucent fill under the curve from the floor up to the current input, its right edge riding the curve (width = input, height = output), plus a dot at the operating point. Add -6 dBFS reference lines on both axes with a tick label. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -211,6 +211,7 @@ impl Plugin for Codename206 {
|
||||
let num_samples = buffer.samples();
|
||||
let mut lvl_l = [0.0f32; meters::NUM_CHANNELS];
|
||||
let mut lvl_r = [0.0f32; meters::NUM_CHANNELS];
|
||||
let mut inp = [0.0f32; meters::NUM_CHANNELS]; // mono input level (detector / gain-curve x)
|
||||
let mut gr = [0.0f32; meters::NUM_CHANNELS];
|
||||
let mut lim_gr = 0.0f32;
|
||||
|
||||
@@ -257,6 +258,7 @@ impl Plugin for Codename206 {
|
||||
let out_r = band_out[b][r].abs();
|
||||
// Wet gain reduction (what the comp computes), independent of the mix.
|
||||
let g = self.comps[b].gain_reduction_db();
|
||||
inp[b] = inp[b].max(in_mono);
|
||||
lvl_l[b] = lvl_l[b].max(out_l);
|
||||
lvl_r[b] = lvl_r[b].max(out_r);
|
||||
gr[b] = gr[b].max(g);
|
||||
@@ -287,6 +289,7 @@ impl Plugin for Codename206 {
|
||||
let out_l = out_frame[0].abs();
|
||||
let out_r = out_frame[r].abs();
|
||||
let g = self.comps[ALL].gain_reduction_db();
|
||||
inp[ALL] = inp[ALL].max(in_mono);
|
||||
lvl_l[ALL] = lvl_l[ALL].max(out_l);
|
||||
lvl_r[ALL] = lvl_r[ALL].max(out_r);
|
||||
gr[ALL] = gr[ALL].max(g);
|
||||
@@ -327,6 +330,7 @@ impl Plugin for Codename206 {
|
||||
for i in 0..meters::NUM_CHANNELS {
|
||||
meters::decay_store(&self.meters.level_l[i], lvl_l[i], w);
|
||||
meters::decay_store(&self.meters.level_r[i], lvl_r[i], w);
|
||||
meters::decay_store(&self.meters.input_level[i], inp[i], w);
|
||||
meters::decay_store(&self.meters.gain_reduction_db[i], gr[i], w);
|
||||
}
|
||||
meters::decay_store(&self.meters.limiter_gr_db, lim_gr, w);
|
||||
|
||||
Reference in New Issue
Block a user