2019-08-30 00:49:58 +02:00
|
|
|
// Copyright (c) 2019, Paul Ferrand
|
|
|
|
|
// All rights reserved.
|
|
|
|
|
|
|
|
|
|
// Redistribution and use in source and binary forms, with or without
|
|
|
|
|
// modification, are permitted provided that the following conditions are met:
|
|
|
|
|
|
|
|
|
|
// 1. Redistributions of source code must retain the above copyright notice, this
|
|
|
|
|
// list of conditions and the following disclaimer.
|
|
|
|
|
// 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
|
// this list of conditions and the following disclaimer in the documentation
|
|
|
|
|
// and/or other materials provided with the distribution.
|
|
|
|
|
|
|
|
|
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
|
|
|
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
|
|
|
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
|
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
|
|
|
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
|
|
|
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
|
|
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
|
|
|
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
|
|
|
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
2019-08-30 15:28:30 +02:00
|
|
|
#include "Region.h"
|
2019-08-25 14:01:03 +02:00
|
|
|
#include "catch2/catch.hpp"
|
2019-08-11 13:31:16 +02:00
|
|
|
using namespace Catch::literals;
|
|
|
|
|
|
|
|
|
|
TEST_CASE("Region activation", "Region tests")
|
|
|
|
|
{
|
2019-09-21 01:07:53 +02:00
|
|
|
sfz::MidiState midiState;
|
|
|
|
|
sfz::Region region { midiState };
|
2019-12-23 01:25:20 +01:00
|
|
|
|
2019-08-11 13:31:16 +02:00
|
|
|
region.parseOpcode({ "sample", "*sine" });
|
|
|
|
|
SECTION("Basic state")
|
|
|
|
|
{
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerCC(4, 0);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-08-11 13:31:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SECTION("Single CC range")
|
|
|
|
|
{
|
|
|
|
|
region.parseOpcode({ "locc4", "56" });
|
|
|
|
|
region.parseOpcode({ "hicc4", "59" });
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerCC(4, 0);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerCC(4, 57);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerCC(4, 56);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerCC(4, 59);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerCC(4, 43);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerCC(4, 65);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerCC(6, 57);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-08-11 13:31:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SECTION("Multiple CC ranges")
|
|
|
|
|
{
|
|
|
|
|
region.parseOpcode({ "locc4", "56" });
|
|
|
|
|
region.parseOpcode({ "hicc4", "59" });
|
|
|
|
|
region.parseOpcode({ "locc54", "18" });
|
|
|
|
|
region.parseOpcode({ "hicc54", "27" });
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerCC(4, 0);
|
|
|
|
|
region.registerCC(54, 0);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerCC(4, 57);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerCC(54, 19);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerCC(54, 18);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerCC(54, 27);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerCC(4, 56);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerCC(4, 59);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerCC(54, 2);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerCC(54, 26);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerCC(4, 65);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-08-11 13:31:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SECTION("Bend ranges")
|
|
|
|
|
{
|
|
|
|
|
region.parseOpcode({ "lobend", "56" });
|
|
|
|
|
region.parseOpcode({ "hibend", "243" });
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerPitchWheel(0);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerPitchWheel(56);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerPitchWheel(243);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerPitchWheel(245);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-08-11 13:31:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SECTION("Aftertouch ranges")
|
|
|
|
|
{
|
|
|
|
|
region.parseOpcode({ "lochanaft", "56" });
|
|
|
|
|
region.parseOpcode({ "hichanaft", "68" });
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerAftertouch(0);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerAftertouch(56);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerAftertouch(68);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerAftertouch(98);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-08-11 13:31:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SECTION("BPM ranges")
|
|
|
|
|
{
|
|
|
|
|
region.parseOpcode({ "lobpm", "56" });
|
|
|
|
|
region.parseOpcode({ "hibpm", "68" });
|
|
|
|
|
region.registerTempo(2.0f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-08-11 13:31:16 +02:00
|
|
|
region.registerTempo(0.90f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-08-11 13:31:16 +02:00
|
|
|
region.registerTempo(1.01f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-08-11 13:31:16 +02:00
|
|
|
region.registerTempo(1.1f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-08-11 13:31:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TODO: add keyswitches
|
|
|
|
|
SECTION("Keyswitches: sw_last")
|
|
|
|
|
{
|
|
|
|
|
region.parseOpcode({ "sw_last", "40" });
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOn(40, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOff(40, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOn(41, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOff(41, 0, 0.5f);
|
2019-08-11 13:31:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SECTION("Keyswitches: sw_last with non-default keyswitch range")
|
|
|
|
|
{
|
|
|
|
|
region.parseOpcode({ "sw_lokey", "30" });
|
|
|
|
|
region.parseOpcode({ "sw_hikey", "50" });
|
|
|
|
|
region.parseOpcode({ "sw_last", "40" });
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOn(60, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOff(60, 0, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOn(40, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOff(40, 0, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOn(60, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOff(60, 0, 0.5f);
|
|
|
|
|
region.registerNoteOn(41, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOff(41, 0, 0.5f);
|
2019-08-11 13:31:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SECTION("Keyswitches: sw_down with non-default keyswitch range")
|
|
|
|
|
{
|
|
|
|
|
region.parseOpcode({ "sw_lokey", "30" });
|
|
|
|
|
region.parseOpcode({ "sw_hikey", "50" });
|
|
|
|
|
region.parseOpcode({ "sw_down", "40" });
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOn(60, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOff(60, 0, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOn(40, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOff(40, 0, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOn(60, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOff(60, 0, 0.5f);
|
|
|
|
|
region.registerNoteOn(41, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOff(41, 0, 0.5f);
|
2019-08-11 13:31:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SECTION("Keyswitches: sw_up with non-default keyswitch range")
|
|
|
|
|
{
|
|
|
|
|
region.parseOpcode({ "sw_lokey", "30" });
|
|
|
|
|
region.parseOpcode({ "sw_hikey", "50" });
|
|
|
|
|
region.parseOpcode({ "sw_up", "40" });
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOn(40, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOff(40, 0, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOn(41, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOn(40, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOff(40, 0, 0.5f);
|
|
|
|
|
region.registerNoteOff(41, 0, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-08-11 13:31:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SECTION("Keyswitches: sw_previous")
|
|
|
|
|
{
|
|
|
|
|
region.parseOpcode({ "sw_previous", "40" });
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOn(40, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOff(40, 0, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOn(41, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOn(40, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOff(40, 0, 0.5f);
|
|
|
|
|
region.registerNoteOff(41, 0, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOn(41, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOff(41, 0, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-08-11 13:31:16 +02:00
|
|
|
}
|
2019-08-25 14:01:03 +02:00
|
|
|
|
2019-08-11 13:31:16 +02:00
|
|
|
SECTION("Sequences: length 2, default position")
|
|
|
|
|
{
|
|
|
|
|
region.parseOpcode({ "seq_length", "2" });
|
|
|
|
|
region.parseOpcode({ "seq_position", "1" });
|
|
|
|
|
region.parseOpcode({ "key", "40" });
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOn(40, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOff(40, 0, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOn(40, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOff(40, 0, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOn(40, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOff(40, 0, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-08-11 13:31:16 +02:00
|
|
|
}
|
|
|
|
|
SECTION("Sequences: length 2, position 2")
|
|
|
|
|
{
|
|
|
|
|
region.parseOpcode({ "seq_length", "2" });
|
|
|
|
|
region.parseOpcode({ "seq_position", "2" });
|
|
|
|
|
region.parseOpcode({ "key", "40" });
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOn(40, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOff(40, 0, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOn(40, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOff(40, 0, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOn(40, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOff(40, 0, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-08-11 13:31:16 +02:00
|
|
|
}
|
|
|
|
|
SECTION("Sequences: length 3, position 2")
|
|
|
|
|
{
|
|
|
|
|
region.parseOpcode({ "seq_length", "3" });
|
|
|
|
|
region.parseOpcode({ "seq_position", "2" });
|
|
|
|
|
region.parseOpcode({ "key", "40" });
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOn(40, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOff(40, 0, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOn(40, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOff(40, 0, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOn(40, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOff(40, 0, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(!region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOn(40, 64, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-12-23 01:25:20 +01:00
|
|
|
region.registerNoteOff(40, 0, 0.5f);
|
2019-08-25 14:01:03 +02:00
|
|
|
REQUIRE(region.isSwitchedOn());
|
2019-08-11 13:31:16 +02:00
|
|
|
}
|
|
|
|
|
}
|