Test cases for cc 120, 121, 123
This commit is contained in:
parent
f2c6ac95a7
commit
6aed0b6709
1 changed files with 48 additions and 0 deletions
|
|
@ -155,4 +155,52 @@ TEST_CASE("[Synth] Testing channel 16")
|
||||||
const auto* region = synth.getVoiceView(0)->getRegion();
|
const auto* region = synth.getVoiceView(0)->getRegion();
|
||||||
REQUIRE( region != nullptr );
|
REQUIRE( region != nullptr );
|
||||||
REQUIRE( region->sample == "dummy16.wav" );
|
REQUIRE( region->sample == "dummy16.wav" );
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_CASE("[Synth] All notes offs/all sounds off (single channel)")
|
||||||
|
{
|
||||||
|
sfz::Synth synth;
|
||||||
|
synth.setNumVoices(8);
|
||||||
|
synth.loadSfzFile(fs::current_path() / "tests/TestFiles/midi_channels.sfz");
|
||||||
|
synth.noteOn(0, 0, 60, 63);
|
||||||
|
synth.noteOn(1, 0, 60, 63);
|
||||||
|
REQUIRE( synth.getNumActiveVoices() == 2 );
|
||||||
|
synth.cc(0, 0, 120, 63);
|
||||||
|
REQUIRE( synth.getNumActiveVoices() == 0 );
|
||||||
|
|
||||||
|
synth.noteOn(0, 0, 60, 63);
|
||||||
|
synth.noteOn(1, 0, 60, 63);
|
||||||
|
REQUIRE( synth.getNumActiveVoices() == 2 );
|
||||||
|
synth.cc(0, 0, 123, 63);
|
||||||
|
REQUIRE( synth.getNumActiveVoices() == 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_CASE("[Synth] All notes offs/all sounds off (multi channel)")
|
||||||
|
{
|
||||||
|
sfz::Synth synth;
|
||||||
|
synth.setNumVoices(8);
|
||||||
|
synth.loadSfzFile(fs::current_path() / "tests/TestFiles/midi_channels.sfz");
|
||||||
|
synth.noteOn(0, 0, 60, 63);
|
||||||
|
synth.noteOn(1, 1, 60, 63);
|
||||||
|
REQUIRE( synth.getNumActiveVoices() == 2 );
|
||||||
|
synth.cc(0, 0, 120, 63);
|
||||||
|
REQUIRE( synth.getNumActiveVoices() == 1 );
|
||||||
|
|
||||||
|
synth.noteOn(0, 0, 60, 63);
|
||||||
|
REQUIRE( synth.getNumActiveVoices() == 2 );
|
||||||
|
synth.cc(0, 0, 123, 63);
|
||||||
|
REQUIRE( synth.getNumActiveVoices() == 1 );
|
||||||
|
synth.cc(0, 1, 123, 63);
|
||||||
|
REQUIRE( synth.getNumActiveVoices() == 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_CASE("[Synth] Reset all controllers")
|
||||||
|
{
|
||||||
|
sfz::Synth synth;
|
||||||
|
synth.cc(0, 0, 12, 64);
|
||||||
|
synth.cc(0, 1, 12, 64);
|
||||||
|
REQUIRE( synth.getMidiState().getCCValue(0, 12) == 64 );
|
||||||
|
synth.cc(0, 0, 121, 64);
|
||||||
|
REQUIRE( synth.getMidiState().getCCValue(0, 12) == 0 );
|
||||||
|
REQUIRE( synth.getMidiState().getCCValue(1, 12) == 64 );
|
||||||
}
|
}
|
||||||
Loading…
Add table
Reference in a new issue