Просмотр исходного кода

Hush De-esser: input / output pan (Pro-DS balance law, measured); Pro-DS state levels read right, input / pans / oversampling translated; docs

Ka1-S 1 месяц назад
Родитель
Сommit
babb67c8d5

+ 5 - 2
docs/PARITY.md

@@ -31,10 +31,10 @@ before → after (blank = not touched in round 165). Lowest first.
 | Ridge Strip | SSL E-Channel (Waves) | 9 | 8 | 165 | 8 → 9 / 7 → 8 |
 | LYNX Tune | Auto-Tune Pro | 8 | 7 | 135 | 165j: sound only (highs kept, measured; scores unchanged) |
 | Ridge Strip (Vocal strip) | SSL Native Vocalstrip 2 | 9 | 7 | 145 | |
-| Hush De-esser | Pro-DS | 8 | 8 | 135 | |
 | Halo | ValhallaShimmer | 8 | 9 | 135 | |
 | Horizon | ValhallaFutureVerb | 8 | 9 | 135 | |
 | Orbit | ValhallaSpaceModulator | 8 | 9 | 135 | |
+| Hush De-esser | Pro-DS | 9 | 8 | 165w | 8 → 9 / 8 → 8 (in / out pan, state levels) |
 | Facet EQ | Pro-Q 4 | 9 | 8 | 152c | |
 | Crest Compressor | Pro-C 3 | 9 | 8 | 137 | |
 | Sentry Gate | Pro-G | 9 | 8 | 135 | |
@@ -446,10 +446,13 @@ output level and pan.
 | LOOKAHEAD knob 0–15 ms with power button | ✅ | round 128 (the look-ahead is the latency; the mixer re-plans its delay compensation) |
 | DISPLAY button (hide / show the waveform) | ✅ | round 128: the window shrinks without it |
 | Oversampling (bottom bar) | ✅ | round 135: Off / 2x / 4x / 8x for Hush's own voicing (the band and its gain at the high rate; the measured classic voicing has none) |
-| In / Out levels (bottom bar) | ✅ | round 128: In ±12 dB, Out ±12 dB (no pan) |
+| In / Out levels (bottom bar) | ⚠️ | round 128: In ±12 dB, Out ±12 dB; [EXEC] round 165w: the 17.1 trial's run −∞ … +36 dB (36 dB per unit above −18); a state's levels are now read right (stored as 2 v − 1; +7.2 dB was read as +0.2) and the input translated |
+| In / Out pan (bottom bar) | ✅ | round 165w [EXEC]: **In pan / Out pan** — the trial's balance law (the far channel × (1 − \|pan\|), the near one untouched; in before the detector, out after the output level), translated from Pro-DS states; oversampling translated too |
 | Release | — | Pro-DS has no release control; LYNX keeps RELEASE as an extra (bottom bar) |
 | Input meter with threshold arrow, reduction meter | ✅ | |
 
+**Round 165w** (REA_rodada165w §5): configuration 8 → **9**, design 8 → 8 — In pan / Out pan (measured balance), the Pro-DS state's levels read correctly, input level / pans / oversampling translated. Left: the −∞ … +36 dB level range, the high-pass up to 20 kHz (Hush: 16 kHz), Stereo Link above 100 % (the mid-only blend) not translated.
+
 ## Ember Saturator ← Saturn 2 (and Decapitator's role)
 
 Parameters of Saturn 2: up to 6 bands × (style — 28: Subtle / Clean / Warm / Broken Tube, Subtle / Clean / Warm /

+ 21 - 1
docs/analise/REA_rodada165w.md

@@ -101,9 +101,29 @@ LYNX (`voicetools::gemini`, core/VoiceTools.{h,cpp}):
   markers sit on their gain values; **Old | Measured** tabs at the top right of the Direct row;
 - translation (`translateWavesDoubler`): the shelves' gains one to one over −88 … +12, EQ law Measured.
 
+## 5. Hush De-esser ← FabFilter Pro-DS (follow-up, branch parity165w2)
+
+Parameter list of the trial (`pds/p.tsv`): Mode, Threshold, Range, Band Processing, Stereo Link (0 … 100 %, then
+"100 %, n % Mid-only" up to 200 %), Stereo Link Mode, Lookahead 0 … 15 ms + Enabled, Audition Triggering, Side Chain
+Input, High-Pass / Low-Pass 2 … 20 kHz, Audition Side Chain, MIDI, Oversampling Off / 2x / 4x, **Input / Output Level
+−∞ … +36 dB** (0.5 = 0 dB, 72 dB per unit above 0.25 = −18 dB, a steeper curve below), **Input / Output Pan −1 … +1**,
+Bypass. Fresh instance: Single Vocal, −36 dB, 6 dB, Wide Band, 100 %, look-ahead 10 ms on, 7.5 … 14 kHz; latency 720.
+
+- **Pan law [EXEC]** (L = 1 kHz, R = 1.5 kHz, threshold 0 dB, range 0; every quarter step): a balance — the far channel
+  × (1 − |pan|), the near one untouched, nothing crosses over; Input Pan and Output Pan alike.
+- **State units [EXEC]** (a component saved after setting Input Level 0.6 = +7.2 dB, Input Pan −0.5, Output Pan +0.75,
+  2x): the 20-value list stores the pans as −1 … +1, the oversampling as an index, and **the levels as 2 v − 1**
+  (+7.2 dB → 0.2). LYNX's translator read the output level as dB (+7.2 dB came back as +0.2 dB); fixed (36 dB per unit,
+  Hush's ±12 dB clamp), and the input level, pans and oversampling are now translated.
+
+LYNX: Hush appended **Input pan / Output pan** (indices 20 / 21, centre by default, so older projects are unchanged):
+input after the input level (the detector hears it), output after everything; "In pan" / "Out pan" dials in the panel.
+Left: the levels' −∞ … +36 dB range, the 20 kHz high-pass, Stereo Link's mid-only half.
+
 ## 4. Tests
 
 tests/Parity165wTests.inc: Gemini's measured shelves against the trial's points (−88 high / low, −24 at 1189 Hz, +12,
 −12; engine within 0.3 dB, the editor's curve within 0.1 dB of the engine), the old law kept and shown on its own scale, older projects /
 presets → Old, deep cuts translated; Glow's measured release against the trial (Compress 46 after 2 s and 10 s, Limit 62.6;
-within 0.45 / 0.6 / 0.7 dB), round 123's tail kept for older projects, the upgrade and the CLA-2A translation.
+within 0.45 / 0.6 / 0.7 dB), round 123's tail kept for older projects, the upgrade and the CLA-2A translation; Hush's pans (balance in / out) and the
+Pro-DS state's levels, pans and oversampling.

+ 2 - 0
resources/i18n/pt-BR.txt

@@ -5400,3 +5400,5 @@ countries: br
 "Black notes" = "Teclas pretas"
 "Sharps (#)" = "Sustenidos (#)"
 "Flats (b)" = "Bemóis (b)"
+"Balance of the input before the de-esser hears it" = "Balanço da entrada antes de o de-esser ouvi-la"
+"Balance of the output" = "Balanço da saída"

+ 11 - 3
src/core/FabFilterStates.cpp

@@ -609,7 +609,8 @@ int fromProQ4 (const State& s, EffectSlot& slot)
 // parameter API, round 148): 0 mode (0 single vocal, 1 allround), 1 threshold (norm: -60 + 60 v dB), 2 range dB,
 // 3 band processing (0 wide band, 1 split band), 4 stereo link, 5 link mode (0 mid, 1 side), 6 look-ahead ms,
 // 7 look-ahead enabled, 8 audition triggering, 9 side-chain input, 10 / 11 high-pass / low-pass (norm: 2000 x 10^v Hz),
-// 12 audition side chain, 13 MIDI, 14 oversampling, 15 / 16 input level / pan, 17 / 18 output level / pan, 19 bypass.
+// 12 audition side chain, 13 MIDI, 14 oversampling (0 off, 1 2x, 2 4x), 15 / 16 input level (2 v − 1: 36 dB per unit) / pan (−1 … +1),
+// 17 / 18 output level / pan, 19 bypass.
 // Single Vocal runs Hush's measured vocal voicing (core/VoiceMatch.h vocalds, fitted to her two states); Allround
 // keeps Hush's own engine in its allround mode.
 int fromProDS (const State& s, EffectSlot& slot)
@@ -635,8 +636,15 @@ int fromProDS (const State& s, EffectSlot& slot)
     const auto lpHz = 2000.0 * std::pow (10.0, std::clamp ((double) s.at (11), 0.0, 1.0));
     p[frequency] = (float) std::clamp (std::log (std::clamp (hpHz, 2000.0, 16000.0) / 2000.0) / std::log (8.0), 0.0, 1.0);
     p[lowPass] = lpHz >= 19999.0 ? 1.0f : (float) std::clamp (std::log (lpHz / 2000.0) / std::log (10.0), 0.0, 0.998);
-    if (std::abs (s.at (17)) <= 12.0f)
-        p[output] = linValue (s.at (17), -12.0, 12.0);
+    // round 165w [EXEC] (a state saved by the trial at +7.2 dB input, pans −0.5 / +0.75, 2x): the levels are stored as
+    // 2 v − 1 of the parameter (0 dB = 0, +36 dB = 1), i.e. 36 dB per unit above −18 dB (the old reading took them as
+    // dB, so +7.2 dB came back as +0.2); Hush's input / output reach ±12 dB (beyond: clamped). The input / output pans
+    // (−1 … +1, a balance in both) and the oversampling (Off / 2x / 4x; Hush's own engine, i.e. Allround)
+    p[output] = linValue (std::clamp (36.0 * s.at (17), -12.0, 12.0), -12.0, 12.0);
+    p[input] = linValue (std::clamp (36.0 * s.at (15), -12.0, 12.0), -12.0, 12.0);
+    p[inputPan] = linValue (std::clamp ((double) s.at (16), -1.0, 1.0), -1.0, 1.0);
+    p[outputPan] = linValue (std::clamp ((double) s.at (18), -1.0, 1.0), -1.0, 1.0);
+    p[oversampling] = (float) std::clamp (roundIndex (s.at (14)), 0, 2) / 3.0f;
     if (s.at (19) >= 0.5f)
         slot.enabled = false;
     return 20;

+ 27 - 2
src/core/MixSuite.cpp

@@ -897,6 +897,18 @@ double lookaheadMs() noexcept { return 2.0; }
 double lookaheadTimeMs (float v) noexcept { return std::round (lin (v, 0.0, 15.0) * 100.0) / 100.0; } // (0.01 ms steps: the default is exactly 2 ms)
 float lookaheadTimeValue (double ms) noexcept { return (float) std::clamp (ms / 15.0, 0.0, 1.0); }
 double classicThresholdDb (float v) noexcept { return lin (v, -80.0, 0.0); }
+double panValue (float v) noexcept { return lin (v, -1.0, 1.0); }
+// round 165w [EXEC] (REA_rodada165w §5): the reference's input / output pan is a balance — the far channel × (1 − |pan|),
+// the near one untouched (both 1 kHz / 1.5 kHz test tones, every quarter step)
+static void balance (float* l, float* r, int n, double pan) noexcept
+{
+    if (pan == 0.0)
+        return;
+    const auto g = (float) (1.0 - std::min (1.0, std::abs (pan)));
+    auto* far = pan > 0.0 ? l : r;
+    for (int i = 0; i < n; ++i)
+        far[i] *= g;
+}
 bool classic (const EffectParams& p) noexcept { return on (p[voicing]); }
 bool vocal (const EffectParams& p) noexcept { return on (p[vocalVoicing]) && ! on (p[voicing]); }
 
@@ -970,7 +982,13 @@ public:
     }
 
 private:
-    void processBlock (float* l, float* r, int n, const EffectParams& p, double) noexcept
+    void processBlock (float* l, float* r, int n, const EffectParams& p, double bpm) noexcept
+    {
+        processCore (l, r, n, p, bpm);
+        balance (l, r, n, panValue (p[outputPan])); // round 165w: after the output level, every voicing
+    }
+
+    void processCore (float* l, float* r, int n, const EffectParams& p, double) noexcept
     {
         // round 128: the look-ahead time is the delay (and the reported latency; the engine re-plans the delay
         // compensation when it moves). The default 2 ms is the old fixed value.
@@ -982,6 +1000,7 @@ private:
             const auto gIn = (float) dbToGain (inGainDb);
             for (int i = 0; i < n; ++i) { l[i] *= gIn; r[i] *= gIn; }
         }
+        balance (l, r, n, panValue (p[inputPan])); // round 165w: after the input level, before the detector
         const auto inPeak = Meters::peak (l, r, n);
         // round 135: oversampling (Hush's own voicing): the gain and the band it acts on are upsampled with the audio
         const auto factor = classic (p) ? 1 : oversamplingOf (p[oversampling]);
@@ -2862,7 +2881,8 @@ const EffectInfo& hushInfo()
                                      { "Stereo link", 1.0f }, { "Link mid", 0.0f }, { "External SC", 0.0f }, { "Input", 0.5f },
                                      { "Display", 1.0f },
                                      { "Oversampling", 0.0f }, // round 135
-                                     { "Vocal voicing", 0.0f } } }; // round 148
+                                     { "Vocal voicing", 0.0f }, // round 148
+                                     { "Input pan", 0.5f }, { "Output pan", 0.5f } } }; // round 165w
     return info;
 }
 
@@ -3138,6 +3158,11 @@ std::string paramText (EffectKind kind, int param, float v)
             case display: return on (v) ? "shown" : "hidden";
             case release: return fmt ("%.0f ms", releaseMs (v));
             case output: return fmt ("%+.1f dB", lin (v, -12.0, 12.0));
+            case inputPan: case outputPan:
+            {
+                const auto pan = panValue (v);
+                return std::abs (pan) < 0.0005 ? std::string ("centre") : fmt (pan < 0.0 ? "%.0f%% L" : "%.0f%% R", std::abs (pan) * 100.0);
+            }
             case voicing: return on (v) ? "classic split" : "modern";
             case oversampling: return oversamplingOf (v) == 1 ? "off" : std::to_string (oversamplingOf (v)) + "x";
             default: return onOff (v);

+ 4 - 1
src/core/MixSuite.h

@@ -207,7 +207,10 @@ namespace hush
 // (core/VoiceMatch.h vocalds: band detector + "stands out" test, look-ahead within a fixed 15 ms latency); uses the
 // threshold, range, frequency (the band's high-pass), low-pass, look-ahead, mode and listen controls
 enum Param { frequency, threshold, range, mode, detector, listen, lookahead, release, output, voicing,
-             allround, lowPass, lookaheadTime, stereoLink, linkMid, external, input, display, oversampling, vocalVoicing, count };
+             allround, lowPass, lookaheadTime, stereoLink, linkMid, external, input, display, oversampling, vocalVoicing,
+             // round 165w (appended): the reference's input / output pan (a balance: the far side × (1 − |pan|), measured)
+             inputPan, outputPan, count };
+double panValue (float v) noexcept; // −1 … +1
 bool vocal (const EffectParams& p) noexcept; // round 148
 int oversamplingOf (float v) noexcept; // 1 (off), 2, 4, 8
 double hz (float v) noexcept;          // 2 .. 16 kHz

+ 2 - 0
src/core/ParamHelp.cpp

@@ -311,6 +311,8 @@ const std::map<std::pair<K, std::string>, const char*>& own()
         { { K::glowLeveler, "opto release" }, TR_NOOP ("Measured: the reference's gain recovery after loud passages; old: the slower tail of projects saved before round 165") },
         // Hush De-esser
         { { K::hushDeEsser, "frequency" }, TR_NOOP ("Where the sibilance is detected and reduced") },
+        { { K::hushDeEsser, "input pan" }, TR_NOOP ("Balance of the input before the de-esser hears it") },
+        { { K::hushDeEsser, "output pan" }, TR_NOOP ("Balance of the output") },
         { { K::hushDeEsser, "threshold" }, TR_NOOP ("Level of sibilance above which the de-esser works") },
         { { K::hushDeEsser, "range" }, TR_NOOP ("The most the sibilance is turned down") },
         { { K::hushDeEsser, "wideband" }, TR_NOOP ("Turns the whole signal down instead of only the sibilant band") },

+ 3 - 0
src/core/PluginLayout.cpp

@@ -1790,6 +1790,9 @@ Layout hushDeEsser()
     v.push_back (dial (412, 58, 40, "Range", TR_NOOP ("Range")));
     v.push_back (dial (300, 142, 32, "Release", TR_NOOP ("Release")));
     v.push_back (dial (376, 142, 32, "Output", TR_NOOP ("Output"), bipolar));
+    // round 165w: the reference's input / output pan (balance)
+    v.push_back (dial (240, 142, 28, "Input pan", TR_NOOP ("In pan"), bipolar));
+    v.push_back (dial (430, 142, 28, "Output pan", TR_NOOP ("Out pan"), bipolar));
     // round 128: the reference de-esser's other controls
     v.push_back (tabs (12, 222, 200, 20, "Allround", TR_NOOP ("Single vocal|Allround")));
     v.push_back (toggle (12, 252, 64, 20, "Link mid", TR_NOOP ("Mid (M/S)")));

+ 8 - 1
src/ui/I18nData.h

@@ -16026,6 +16026,13 @@ inline constexpr unsigned char ptBR[] = {
 34, 10, 34, 66, 108, 97, 99, 107, 32, 110, 111, 116, 101, 115, 34, 32, 61, 32, 34, 84, 101, 99, 108, 97,
 115, 32, 112, 114, 101, 116, 97, 115, 34, 10, 34, 83, 104, 97, 114, 112, 115, 32, 40, 35, 41, 34, 32, 61,
 32, 34, 83, 117, 115, 116, 101, 110, 105, 100, 111, 115, 32, 40, 35, 41, 34, 10, 34, 70, 108, 97, 116, 115,
-32, 40, 98, 41, 34, 32, 61, 32, 34, 66, 101, 109, 195, 179, 105, 115, 32, 40, 98, 41, 34, 10,
+32, 40, 98, 41, 34, 32, 61, 32, 34, 66, 101, 109, 195, 179, 105, 115, 32, 40, 98, 41, 34, 10, 34, 66,
+97, 108, 97, 110, 99, 101, 32, 111, 102, 32, 116, 104, 101, 32, 105, 110, 112, 117, 116, 32, 98, 101, 102, 111,
+114, 101, 32, 116, 104, 101, 32, 100, 101, 45, 101, 115, 115, 101, 114, 32, 104, 101, 97, 114, 115, 32, 105, 116,
+34, 32, 61, 32, 34, 66, 97, 108, 97, 110, 195, 167, 111, 32, 100, 97, 32, 101, 110, 116, 114, 97, 100, 97,
+32, 97, 110, 116, 101, 115, 32, 100, 101, 32, 111, 32, 100, 101, 45, 101, 115, 115, 101, 114, 32, 111, 117, 118,
+105, 45, 108, 97, 34, 10, 34, 66, 97, 108, 97, 110, 99, 101, 32, 111, 102, 32, 116, 104, 101, 32, 111, 117,
+116, 112, 117, 116, 34, 32, 61, 32, 34, 66, 97, 108, 97, 110, 195, 167, 111, 32, 100, 97, 32, 115, 97, 195,
+173, 100, 97, 34, 10,
 };
 } // namespace lynx::i18n::data

+ 72 - 0
tests/Parity165wTests.inc

@@ -188,3 +188,75 @@ TEST (glow_older_projects_keep_the_round123_release_round165w)
     const auto s = vm123::wavesSlot ("CLA-2A", values.c_str(), n);
     CHECK (s.kind == EffectKind::glowLeveler && s.params[g::releaseLaw] == 1.0f);
 }
+
+// Hush De-esser ← Pro-DS: the reference's input / output pan (a balance, measured) and its state's levels and pans
+namespace p165w
+{
+// a "FabF" version-2 component state named "Default Setting" holding `values` (as tests/Vox148Tests.inc)
+inline std::vector<std::uint8_t> fabf (const std::vector<float>& values)
+{
+    std::vector<std::uint8_t> b { 'F', 'a', 'b', 'F' };
+    auto put = [&b] (std::uint32_t u) {
+        for (int i = 0; i < 4; ++i)
+            b.push_back ((std::uint8_t) (u >> (8 * i)));
+    };
+    const std::string name = "Default Setting";
+    put (2);
+    put ((std::uint32_t) name.size());
+    b.insert (b.end(), name.begin(), name.end());
+    put (0);
+    put ((std::uint32_t) values.size());
+    for (const auto v : values)
+    {
+        std::uint32_t u;
+        std::memcpy (&u, &v, 4);
+        put (u);
+    }
+    put (1); put (1);
+    return b;
+}
+} // namespace p165w
+TEST (hush_input_output_pan_round165w)
+{
+    using namespace lynx;
+    namespace h = mixsuite::hush;
+    const auto& info = effectInfo (EffectKind::hushDeEsser);
+    CHECK ((int) info.params.size() == h::count && h::outputPan == h::count - 1);
+    auto p = makeEffectSlot (EffectKind::hushDeEsser).params;
+    CHECK (p[h::inputPan] == 0.5f && p[h::outputPan] == 0.5f); // older projects load the centre: unchanged
+    CHECK (formatEffectParam (EffectKind::hushDeEsser, h::outputPan, 0.25f, 120.0) == "50% L");
+    p[h::threshold] = 1.0f; // 0 dB: nothing to de-ess
+    const auto run = [&] (const EffectParams& q, double& gl, double& gr) {
+        auto fx = makeEffect (EffectKind::hushDeEsser);
+        fx->prepare (48000.0);
+        std::vector<float> l (9600), r;
+        for (std::size_t i = 0; i < l.size(); ++i)
+            l[i] = 0.1f * (float) std::sin (2.0 * 3.141592653589793 * 1000.0 * (double) i / 48000.0);
+        r = l;
+        const auto x = l;
+        for (std::size_t off = 0; off < l.size(); off += 256)
+            fx->process (l.data() + off, r.data() + off, (int) std::min<std::size_t> (256, l.size() - off), q, 120.0);
+        double el = 0, er = 0, ex = 0;
+        for (std::size_t i = 4800; i < l.size(); ++i) { el += (double) l[i] * l[i]; er += (double) r[i] * r[i]; ex += (double) x[i] * x[i]; }
+        gl = std::sqrt (el / ex);
+        gr = std::sqrt (er / ex);
+    };
+    double gl = 0, gr = 0;
+    // [EXEC] the trial: pan +0.5 keeps the right channel and halves the left; −1 silences the right; the same law in and out
+    auto q = p;
+    q[h::outputPan] = 0.75f;
+    run (q, gl, gr);
+    CHECK (std::abs (gl - 0.5) < 0.01 && std::abs (gr - 1.0) < 0.01);
+    q = p;
+    q[h::inputPan] = 0.0f;
+    run (q, gl, gr);
+    CHECK (std::abs (gl - 1.0) < 0.01 && gr < 1e-3);
+    // a Pro-DS state with input +7.2 dB, input pan −0.5, output pan +0.75, 2x (as the trial saved it)
+    // (her first state's values, tests/Vox148Tests.inc, with these four changed)
+    std::vector<float> st { 0.0f, 0.2715f, 6.0f, 0.0f, 0.5f, 0.0f, 12.0f, 1.0f, 0.0f, 0.0f, 0.54407f, 0.8451f,
+                            0.0f, 0.0f, 1.0f, 0.2f, -0.5f, 0.0f, 0.75f, 0.0f };
+    int n = 0;
+    const auto s = m124x::substitute ("FabFilter Pro-DS", p165w::fabf (st), n);
+    CHECK (std::abs (h::panValue (s.params[h::inputPan]) + 0.5) < 1e-4 && std::abs (h::panValue (s.params[h::outputPan]) - 0.75) < 1e-4);
+    CHECK (std::abs (s.params[h::input] - (7.2f + 12.0f) / 24.0f) < 1e-4 && h::oversamplingOf (s.params[h::oversampling]) == 2);
+}