From ccbcf4a4c7edf1e2bd667eb01999fd6fa1e286d7 Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Mon, 10 Feb 2020 00:18:11 +0100 Subject: [PATCH] Remove a helper; no clamping for normalizePercent --- src/sfizz/SfzHelpers.h | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/sfizz/SfzHelpers.h b/src/sfizz/SfzHelpers.h index 37cf3dda..71d3c4f1 100644 --- a/src/sfizz/SfzHelpers.h +++ b/src/sfizz/SfzHelpers.h @@ -71,7 +71,7 @@ constexpr float normalizeVelocity(T velocity) template constexpr float normalizePercents(T percentValue) { - return std::min(std::max(static_cast(percentValue), 0.0f), 100.0f) / 100.0f; + return percentValue * 0.01f; } /** @@ -86,19 +86,6 @@ constexpr float normalizeBend(float bendValue) return std::min(std::max(bendValue, -8191.0f), 8191.0f) / 8191.0f; } -/** - * @brief Normalize a possibly negative percentage between -1 and 1 - * - * @tparam T - * @param percentValue - * @return constexpr float - */ -template -constexpr float normalizeNegativePercents(T percentValue) -{ - return std::min(std::max(static_cast(percentValue), -100.0f), 100.0f) / 100.0f; -} - /** * @brief If a cc switch exists for the value, returns the value with the CC modifier, otherwise returns the value alone. *