Γ-W1-T2: the published GR meter reads the limiter, not the mute

Retire the effectiveGain blend so the meter's minimum tracks smoothGain's own
reduction against real input, unscaled by the transition mute — a toggle over
quiet material now reads no reduction instead of pinning to 0.
This commit is contained in:
2026-08-01 21:08:13 -04:00
parent 6232851c6b
commit 91c1b78d5e
4 changed files with 59 additions and 9 deletions
+4 -2
View File
@@ -197,8 +197,10 @@ float Limiter::process(float* left, float* right, int frames) {
left[i] = 0.f;
if (stereo) right[i] = 0.f;
}
const float effectiveGain = s >= 1.f ? gain : s * gain;
if (effectiveGain < blockMin) blockMin = effectiveGain;
// `gain` is the limiter's own reduction, computed from the real input this sample
// whether or not the mute is currently scaling it toward silence — publishing it
// unscaled is what lets the meter show "really limiting" and not "just muting".
if (gain < blockMin) blockMin = gain;
// A disengage is tested FIRST so a toggle-off arriving mid-engage abandons the prime
// instead of waiting it out in silence.
+6 -4
View File
@@ -79,10 +79,12 @@ public:
bool enabled() const { return target_.load(std::memory_order_relaxed); }
// Applies the limiter in place over `frames` of `left` (and `right`, which may be null for
// a mono buffer). Returns the SMALLEST gain actually applied to the output this block — 1.0
// for a settled bypass, 0.0 anywhere the transition mute is at silence. The transition mute
// counts because the contract is the gain that REACHED the output: the reported value and
// the signal are scaled by the same factor, or the meter and the bus disagree.
// a mono buffer). Returns the SMALLEST gain the LIMITER ITSELF computed this block —
// smoothGain's output against the real input, at every sample including a muted one — NOT
// scaled by the transition mute. The mute is a switch, not limiting: scaling by it would
// report 0.0 (full reduction) on every toggle regardless of program content, which is a
// meter defect, not a fact about the bus. 1.0 means no detected peak exceeded the ceiling,
// whether settled bypassed or mid-mute over quiet material.
float process(float* left, float* right, int frames);
private:
+4 -1
View File
@@ -40,7 +40,10 @@ class ReaSamplerEmbed; // embedded TCP/MCP UI shell (owned below; see queryInte
struct MasterBusMeter {
float peakL = 0.f; // max |x| this block
float peakR = 0.f;
float minGain = 1.f; // smallest limiter gain applied this block; 1 = no reduction
// Smallest gain the LIMITER computed this block (Limiter::process) — deliberately NOT
// scaled by the transition mute, so a toggle over quiet material reads 1 (no reduction)
// rather than the mute's own weight. 1 = no reduction.
float minGain = 1.f;
bool clip = false; // LATCHED at a block peak >= 0 dBFS; only clearMasterBusClip lowers it
};