From 06cf476fb3b391ff7f3f4038da214b22a53d9738 Mon Sep 17 00:00:00 2001 From: Elmo Date: Tue, 17 Aug 2021 16:57:07 +0300 Subject: [PATCH] Add failing test case for staccato off grops --- tests/SynthT.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/SynthT.cpp b/tests/SynthT.cpp index 314795d4..b3f32f1a 100644 --- a/tests/SynthT.cpp +++ b/tests/SynthT.cpp @@ -1568,6 +1568,26 @@ TEST_CASE("[Synth] Off by alone and repeated") REQUIRE( numPlayingVoices(synth) == 3 ); } +TEST_CASE("[Synth] Off by with staccato notes") +{ + sfz::Synth synth; + sfz::AudioBuffer buffer { 2, static_cast(synth.getSamplesPerBlock()) }; + + synth.loadSfzString(fs::current_path(), R"( + group=1 off_by=1 sample=*sine ampeg_release=2 + )"); + synth.noteOn(0, 60, 85); + synth.renderBlock(buffer); + REQUIRE( numPlayingVoices(synth) == 1 ); + synth.noteOff(0, 60, 85); + synth.renderBlock(buffer); + REQUIRE( numPlayingVoices(synth) == 0 ); + REQUIRE( numActiveVoices(synth) == 1 ); + synth.noteOn(0, 62, 85); + synth.renderBlock(buffer); + REQUIRE( numActiveVoices(synth) == 1 ); +} + TEST_CASE("[Synth] Off by same note and group") {