diff --git a/tests/SynthT.cpp b/tests/SynthT.cpp index 3ca5db3f..a7108eaf 100644 --- a/tests/SynthT.cpp +++ b/tests/SynthT.cpp @@ -1693,6 +1693,23 @@ TEST_CASE("[Synth] Off by a CC event") REQUIRE( playingSamples(synth) == std::vector { "*sine" }); } +TEST_CASE("[Synth] CC triggered off by a CC event") +{ + sfz::Synth synth; + sfz::AudioBuffer buffer { 2, static_cast(synth.getSamplesPerBlock()) }; + + synth.loadSfzString(fs::current_path(), R"( + group=1 off_by=2 sample=*saw hikey=-1 on_locc64=126 on_hicc64=127 + group=2 sample=*triangle hikey=-1 on_locc64=0 on_hicc64=1 + )"); + synth.cc(0, 64, 127); + synth.renderBlock(buffer); + REQUIRE( playingSamples(synth) == std::vector { "*saw" }); + synth.cc(0, 64, 0); + synth.renderBlock(buffer); + REQUIRE( playingSamples(synth) == std::vector { "*triangle" }); +} + TEST_CASE("[Synth] Off by a note-off event") { sfz::Synth synth;