|
|
@@ -3,8 +3,10 @@
|
|
|
// notes (GitHub #198): the capture runs in process()'s per-piece loop only, so a block is refused while a channel is
|
|
|
// marked (BatchRefusal::midiBetweenUnits) and batched again once nothing is marked;
|
|
|
// - LYNX Tune reads its MIDI target channel's held notes in process(): it follows them (followsHeldNotesWith) only with
|
|
|
-// a MIDI channel set, so a block with it stays piece by piece then.
|
|
|
+// a MIDI channel set, so a block with it stays piece by piece then;
|
|
|
+// - round 190lf's L2 law on the Limiter reports its latency before the first block.
|
|
|
|
|
|
+#include "core/LimiterLaw.h"
|
|
|
#include "core/LynxTune.h"
|
|
|
|
|
|
TEST (rollup030_step9_no_batched_block_while_plugins_own_notes_are_recorded)
|
|
|
@@ -61,3 +63,26 @@ TEST (rollup030_step9_lynx_tune_follows_held_notes_only_with_a_midi_channel)
|
|
|
slot.params[(std::size_t) lynxtune::midiChannel] = 3.0f / 128.0f; // (Channel Rack channel 3)
|
|
|
CHECK (fx->followsHeldNotesWith (slot.params));
|
|
|
}
|
|
|
+
|
|
|
+// round 190lf's L2 law on the Limiter: the latency PDC reads after prepare(), before any block, is already the law's
|
|
|
+// window (issue #113's rule; tests/Pdc188eTests.inc found 66 before / 59 after at 44.1 kHz)
|
|
|
+TEST (rollup030_step9_limiter_l2_latency_is_known_before_the_first_block)
|
|
|
+{
|
|
|
+ using namespace lynx;
|
|
|
+ auto s = makeEffectSlot (EffectKind::limiter);
|
|
|
+ s.params[(std::size_t) limiterlaw::lawParam] = limiterlaw::l2LawValue;
|
|
|
+ for (const auto rate : { 44100.0, 48000.0, 96000.0 })
|
|
|
+ {
|
|
|
+ auto fx = makeEffect (s);
|
|
|
+ fx->prepare (rate);
|
|
|
+ const auto before = fx->latencySamples();
|
|
|
+ std::vector<float> l (512, 0.0f), r (512, 0.0f);
|
|
|
+ fx->process (l.data(), r.data(), 512, s.params, 120.0);
|
|
|
+ CHECK ((before) == (fx->latencySamples()));
|
|
|
+ if (rate == 48000.0)
|
|
|
+ CHECK ((before) == (64));
|
|
|
+ }
|
|
|
+ auto classic = makeEffect (makeEffectSlot (EffectKind::limiter));
|
|
|
+ classic->prepare (48000.0);
|
|
|
+ CHECK ((classic->latencySamples()) == (72));
|
|
|
+}
|