diff --git a/src/sfizz/Synth.h b/src/sfizz/Synth.h index 6ee6da73..9f053cc9 100644 --- a/src/sfizz/Synth.h +++ b/src/sfizz/Synth.h @@ -339,7 +339,7 @@ public: */ void disableFreeWheeling() noexcept; - const MidiState& getMidiState() const noexcept { return resources.midiState; } + const Resources& getResources() const noexcept { return resources; } /** * @brief Check if the SFZ should be reloaded. diff --git a/tests/FilesT.cpp b/tests/FilesT.cpp index 2442d8df..876aef89 100644 --- a/tests/FilesT.cpp +++ b/tests/FilesT.cpp @@ -394,9 +394,10 @@ TEST_CASE("[Files] Default path is ignored for generators") TEST_CASE("[Files] Set CC applies properly") { sfz::Synth synth; + const auto& midiState = synth.getResources().midiState; synth.loadSfzFile(fs::current_path() / "tests/TestFiles/set_cc.sfz"); - REQUIRE(synth.getMidiState().getCCValue(142) == 63_norm); - REQUIRE(synth.getMidiState().getCCValue(61) == 122_norm); + REQUIRE(midiState.getCCValue(142) == 63_norm); + REQUIRE(midiState.getCCValue(61) == 122_norm); } TEST_CASE("[Files] Note and octave offsets") diff --git a/tests/SynthT.cpp b/tests/SynthT.cpp index bd0d28cc..29b55645 100644 --- a/tests/SynthT.cpp +++ b/tests/SynthT.cpp @@ -140,10 +140,11 @@ TEST_CASE("[Synth] All notes offs/all sounds off") TEST_CASE("[Synth] Reset all controllers") { sfz::Synth synth; + const auto& midiState = synth.getResources().midiState; synth.cc(0, 12, 64); - REQUIRE(synth.getMidiState().getCCValue(12) == 64_norm); + REQUIRE(midiState.getCCValue(12) == 64_norm); synth.cc(0, 121, 64); - REQUIRE(synth.getMidiState().getCCValue(12) == 0_norm); + REQUIRE(midiState.getCCValue(12) == 0_norm); } TEST_CASE("[Synth] Releasing before the EG started smoothing (initial delay) kills the voice")