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

Round 170i3: FL cut groups skip FL plugin generators (Ogun tails like FL), Ogun delay/reverb switches, Wave Traveller older header

Ka1-S 1 месяц назад
Родитель
Сommit
06b554b04b
5 измененных файлов с 19 добавлено и 12 удалено
  1. 3 3
      docs/analise/REA_rodada170i3.md
  2. 1 1
      src/core/Ogun.h
  3. 1 1
      src/core/PluginLayoutSynths.cpp
  4. 13 6
      tests/FlQ170i3Tests.inc
  5. 1 1
      tests/tests.cpp

+ 3 - 3
docs/analise/REA_rodada170i3.md

@@ -58,8 +58,8 @@ read overwrites: the version is never compared. LYNX (`wavetrav::parseState`) no
 
 From the dead-control audit (round 170i3c): Ogun's delay runs only with the byte after P (`S.b358[1]`, its tempo
 sync `b358[0]`) set, and its reverb only with P[53]'s low byte (`designDelay` / `designReverb`). LYNX's Ogun / Autogun
-editor had no switch for any of them, so on a new channel (FL's Plugin database Ogun: both off) the delay knobs P26–P30
-and reverb knobs P31–P39 changed nothing. `ogunParam` / `ogunSetParam` now read / write them (index 53 = reverb on,
+editor had no switch for any of them. FL's Plugin database Ogun has the delay off (tempo sync on) and the reverb on,
+so on a new channel the delay knobs P26–P30 changed nothing and the reverb could not be switched off. `ogunParam` / `ogunSetParam` now read / write them (index 53 = reverb on,
 64 = delay tempo sync, 65 = delay on: LYNX's indices, not FL host parameters), and the editor shows the three
 switches. Test `flq170i3_ogun_delay_and_reverb_switches_change_the_sound`.
 
@@ -87,7 +87,7 @@ shows a dialog (*roblem* / *rror* / *issing*) or no render arrives for 120 s.
 |---|---|---|
 | FL generator in a cut group (incl. "cut itself") | choked at the next note | keeps sounding, like FL |
 | Ogun's tail in 169l's project | −82 dB at 1.4 s (choked by Drumaxx) | FL's within 1 dB to −80 dB |
-| Ogun / Autogun editor: delay on, delay tempo sync, reverb on | missing (delay and reverb knobs dead) | switches |
+| Ogun / Autogun editor: delay on, delay tempo sync, reverb on | missing (delay knobs dead on a new channel) | switches |
 | Wave Traveller's FL Default.fst | refused (empty channel) | loads |
 
 ## Where I stopped

+ 1 - 1
src/core/Ogun.h

@@ -50,7 +50,7 @@ bool autogunStateUsable (const std::vector<std::uint8_t>& state);
 // own loader reads it (round 169l); newer or unreadable states unchanged. Keeps ogunParam / ogunSetParam valid.
 std::vector<std::uint8_t> ogunCurrentLayout (const std::vector<std::uint8_t>& state);
 // index 53 is the reverb's on switch (P[53]'s low byte); 64 / 65 are the delay's tempo-sync and on switches, the two
-// bytes after P (round 170i3: the editor had no switch for them, so a new channel's delay and reverb knobs did nothing)
+// bytes after P (round 170i3: the editor had no switch for them, so a new channel's delay knobs did nothing)
 constexpr int ogunReverbOnIndex = 53, ogunDelayTempoIndex = 64, ogunDelayOnIndex = 65;
 std::optional<int> ogunParam (const std::vector<std::uint8_t>& state, int index);
 // Writes P[index] (the state is re-wrapped as zlib with stored blocks); false if the state can't be read

+ 1 - 1
src/core/PluginLayoutSynths.cpp

@@ -479,7 +479,7 @@ Layout ogunLayout (bool autogun)
     p.fader (148, 452, 18, 74, "Chorus mix", TR_NOOP ("Mix"), bipolar);
     p.section (176, 434, 160, 114, TR_NOOP ("Delay"));
     p.stepper (184, 466, 40, 22, "Delay feedback mode", TR_NOOP ("Mode"), 3);
-    // (round 170i3: the delay and reverb run only with these switches on; FL's Plugin database Ogun has both off)
+    // (round 170i3: the delay and reverb run only with these switches on; FL's Plugin database Ogun: delay off, reverb on)
     p.toggle (184, 496, 48, 16, "Delay on", TR_NOOP ("On"), boxed);
     p.toggle (184, 518, 48, 16, "Delay tempo sync", TR_NOOP ("Tempo"), boxed);
     p.fader (240, 452, 18, 74, "Delay feedback", TR_NOOP ("Fb"));

+ 13 - 6
tests/FlQ170i3Tests.inc

@@ -86,7 +86,7 @@ TEST (flq170i3_cut_groups_skip_fl_plugin_generators)
 TEST (flq170i3_ogun_delay_and_reverb_switches_change_the_sound)
 {
     // Ogun's delay only runs with S.b358[1] set and its reverb with P[53]'s low byte (designDelay / designReverb): the
-    // editor had no switch for them, so on FL's Plugin database Ogun the delay and reverb knobs did nothing
+    // editor had no switch for them, so on FL's Plugin database Ogun (delay off) the delay knobs did nothing
     using namespace lynx;
     if (realFlpDir.empty())
         return;
@@ -95,7 +95,10 @@ TEST (flq170i3_ogun_delay_and_reverb_switches_change_the_sound)
     if (db.empty())
         return;
     auto base = ogunCurrentLayout (db);
-    CHECK (ogunSetParam (base, ogunDelayOnIndex, 0) && ogunSetParam (base, ogunReverbOnIndex, 0));
+    const auto dbDelay = ogunParam (base, ogunDelayOnIndex).value_or (-1), dbSync = ogunParam (base, ogunDelayTempoIndex).value_or (-1),
+               dbReverb = ogunParam (base, ogunReverbOnIndex).value_or (-1);
+    CHECK (ogunSetParam (base, ogunDelayOnIndex, 0) && ogunSetParam (base, ogunReverbOnIndex, 0)
+           && ogunSetParam (base, ogunDelayTempoIndex, 0));
     CHECK (ogunParam (base, ogunDelayOnIndex) == 0 && ogunParam (base, ogunReverbOnIndex) == 0);
     ogun::RefNote n;
     n.key = 60;
@@ -117,14 +120,18 @@ TEST (flq170i3_ogun_delay_and_reverb_switches_change_the_sound)
     auto synced = delayed;
     CHECK (ogunSetParam (synced, ogunDelayTempoIndex, 1) && ogunParam (synced, ogunDelayTempoIndex) == 1);
     const auto withSync = tail (synced);
+    // (at 140 BPM a synced 192 is 0.43 s, unsynced 0.5 s: same energy, other echo times)
+    const auto a = ogun::renderReference (delayed, { n }, 44100.0, length), b = ogun::renderReference (synced, { n }, 44100.0, length);
+    double moved = 0.0;
+    for (std::size_t i = 0; i < a.size() && i < b.size(); ++i)
+        moved += ((double) a[i] - b[i]) * ((double) a[i] - b[i]);
     auto reverb = base;
-    const auto p53 = ogunParam (db, 53).value_or (0);
     CHECK (ogunSetParam (reverb, ogunReverbOnIndex, 1) && ogunParam (reverb, ogunReverbOnIndex) == 1);
     CHECK (ogunSetParam (reverb, 39, 120));
     const auto withReverb = tail (reverb);
-    std::printf ("  Ogun tail energy: dry %.3g, delay %.3g, delay synced %.3g, reverb %.3g (P53 was %d)\n", dry, withDelay,
-                 withSync, withReverb, p53);
+    std::printf ("  Ogun tail energy: dry %.3g, delay %.3g, delay synced %.3g, reverb %.3g (the database patch: delay %d, sync %d, reverb %d)\n",
+                 dry, withDelay, withSync, withReverb, dbDelay, dbSync, dbReverb);
     CHECK (withDelay > 1.5 * dry + 1e-6);
-    CHECK (std::abs (withSync - withDelay) > 1e-3 * withDelay);
+    CHECK (moved > 0.1 * withSync);
     CHECK (withReverb > 1.5 * dry + 1e-6);
 }

+ 1 - 1
tests/tests.cpp

@@ -9118,7 +9118,7 @@ TEST (ogun_engine)
         std::ofstream (dump, std::ios::binary).write ((const char*) blob.data(), (std::streamsize) blob.size());
     CHECK (lynx::ogunStateUsable (blob));
     CHECK (lynx::ogunFallbacks (blob).empty());
-    CHECK (lynx::ogunParam (blob, 17) == 180 && lynx::ogunParam (blob, 52) == 9 && ! lynx::ogunParam (blob, 64));
+    CHECK (lynx::ogunParam (blob, 17) == 180 && lynx::ogunParam (blob, 52) == 9 && ! lynx::ogunParam (blob, lynx::ogunDelayOnIndex + 1));
     auto broken = blob;
     broken.resize (broken.size() - 300);
     CHECK (! lynx::ogunStateUsable (broken));