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

--trackfreezetest: Flatten and Bounce Track in Place compared over the song (the clips end with the arrangement); LYNX_TRACKFREEZE_KEEP keeps the renders (round 190ff)

Ka1-S 3 недель назад
Родитель
Сommit
9655e9599e
1 измененных файлов с 16 добавлено и 3 удалено
  1. 16 3
      src/Main.cpp

+ 16 - 3
src/Main.cpp

@@ -17133,7 +17133,8 @@ private:
                 reader->read (&m.audio, 0, (int) reader->lengthInSamples, 0, true, true);
                 m.audioSeconds = (double) reader->lengthInSamples / reader->sampleRate;
             }
-            file.deleteFile();
+            if (juce::SystemStats::getEnvironmentVariable ("LYNX_TRACKFREEZE_KEEP", {}).isEmpty()) // (kept: to look at a residual)
+                file.deleteFile();
             return m;
         };
         const auto residual = [] (const Mix& a, const Mix& b, float& peak) {
@@ -17266,7 +17267,14 @@ private:
                 audioClips += c.kind == lynx::ClipKind::audio && c.channel == 0;
             report << "flattened Lead: " << audioClips << " audio clips\n";
             write ("flattened");
-            nullLine ("flattened (Lead) + frozen (others) vs live", live, renderMix ("flattened"), -90.0);
+            // over the song (the flattened clips end where the arrangement ends, as a frozen track plays; an export's
+            // ring-out after the song's end is not in them)
+            const auto span = (int) std::llround (before.secondsForTicks (24 * lynx::ppq) * offline.getTransport().sampleRate.load());
+            auto flatMix = renderMix ("flattened");
+            auto reference = live;
+            reference.audio.setSize (2, juce::jmin (span, reference.audio.getNumSamples()), true);
+            flatMix.audio.setSize (2, reference.audio.getNumSamples(), true);
+            nullLine ("flattened (Lead) + frozen (others) vs live, over the song", reference, flatMix, -90.0);
             offline.undo();
             offline.dispatchPendingMessages();
             check (savedJson (offline.getSong()) == savedJson (frozenSong), "undo of the Flatten: the frozen project exactly as before");
@@ -17285,7 +17293,12 @@ private:
             check (error.isEmpty(), "Bounce Track in Place of the live Bass" + (error.isEmpty() ? juce::String() : ": " + error));
             check (offline.getSong().channels[1].instrument == lynx::InstrumentKind::audioClip && ! offline.getSong().channels[1].freeze.on(),
                    "the Bass is audio, not frozen");
-            nullLine ("Bass bounced in place vs live", live, renderMix ("bounced"), -90.0);
+            auto bouncedMix = renderMix ("bounced");
+            auto reference = live;
+            const auto span = (int) std::llround (before.secondsForTicks (24 * lynx::ppq) * offline.getTransport().sampleRate.load());
+            reference.audio.setSize (2, juce::jmin (span, reference.audio.getNumSamples()), true);
+            bouncedMix.audio.setSize (2, reference.audio.getNumSamples(), true);
+            nullLine ("Bass bounced in place vs live, over the song", reference, bouncedMix, -90.0);
             offline.undo();
             offline.dispatchPendingMessages();
             check (savedJson (offline.getSong()) == jsonBefore, "undo of Bounce Track in Place: the project as before");