From a4e55185420961d359de7db502924af237354a42 Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Sat, 4 Jul 2020 14:44:10 +0200 Subject: [PATCH 1/2] Correct MSVC errors and warnings --- src/sfizz/MathHelpers.h | 1 + src/sfizz/Region.cpp | 3 ++- src/sfizz/Synth.cpp | 6 ++++-- tests/InterpolatorsT.cpp | 3 ++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/sfizz/MathHelpers.h b/src/sfizz/MathHelpers.h index b446d873..f0dbebc4 100644 --- a/src/sfizz/MathHelpers.h +++ b/src/sfizz/MathHelpers.h @@ -15,6 +15,7 @@ #include "SIMDConfig.h" #include "absl/types/span.h" #include +#include #include #include #include diff --git a/src/sfizz/Region.cpp b/src/sfizz/Region.cpp index 424269f7..bbfd5e8e 100644 --- a/src/sfizz/Region.cpp +++ b/src/sfizz/Region.cpp @@ -409,8 +409,9 @@ bool sfz::Region::parseOpcode(const Opcode& rawOpcode) if (opcode.parameters.back() > 127) return false; + const auto inputVelocity = static_cast(opcode.parameters.back()); if (value) - velocityPoints.emplace_back(opcode.parameters.back(), *value); + velocityPoints.emplace_back(inputVelocity, *value); } break; case hash("xfin_lokey"): diff --git a/src/sfizz/Synth.cpp b/src/sfizz/Synth.cpp index 0016f300..02793692 100644 --- a/src/sfizz/Synth.cpp +++ b/src/sfizz/Synth.cpp @@ -301,8 +301,10 @@ void sfz::Synth::handleControlOpcodes(const std::vector& members) ccLabels.emplace_back(member.parameters.back(), std::string(member.value)); break; case hash("label_key&"): - if (Default::keyRange.containsWithEnd(member.parameters.back())) - keyLabels.emplace_back(member.parameters.back(), std::string(member.value)); + if (member.parameters.back() <= Default::keyRange.getEnd()) { + const auto noteNumber = static_cast(member.parameters.back()); + keyLabels.emplace_back(noteNumber, std::string(member.value)); + } break; case hash("default_path"): defaultPath = absl::StrReplaceAll(trim(member.value), { { "\\", "/" } }); diff --git a/tests/InterpolatorsT.cpp b/tests/InterpolatorsT.cpp index 04742547..93193a12 100644 --- a/tests/InterpolatorsT.cpp +++ b/tests/InterpolatorsT.cpp @@ -6,7 +6,8 @@ #include "sfizz/Interpolators.h" #include "catch2/catch.hpp" -#include +#include +#include using namespace Catch::literals; TEST_CASE("[Interpolators] Sample at points") From 007fcbb3a3cbfca21766595ba2048dec7dad21c8 Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Sat, 4 Jul 2020 18:55:39 +0200 Subject: [PATCH 2/2] Deactivate the gain smoothing --- src/sfizz/Config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sfizz/Config.h b/src/sfizz/Config.h index 9268cb89..65cc2286 100644 --- a/src/sfizz/Config.h +++ b/src/sfizz/Config.h @@ -41,7 +41,7 @@ namespace config { constexpr int numVoices { 64 }; constexpr unsigned maxVoices { 256 }; constexpr unsigned smoothingSteps { 512 }; - constexpr uint8_t gainSmoothing { 5 }; + constexpr uint8_t gainSmoothing { 0 }; constexpr unsigned powerTableSizeExponent { 11 }; constexpr int maxFilePromises { maxVoices }; constexpr int sustainCC { 64 };