diff --git a/src/sfizz/SfzHelpers.h b/src/sfizz/SfzHelpers.h index 2290d5df..0f9284c7 100644 --- a/src/sfizz/SfzHelpers.h +++ b/src/sfizz/SfzHelpers.h @@ -87,6 +87,17 @@ inline constexpr float normalizePercents(T percentValue) return std::min(std::max(static_cast(percentValue), 0.0f), 100.0f) / 100.0f; } +/** + * @brief Normalize bends between -1 and 1 + * + * @param bendValue + * @return constexpr float + */ +inline constexpr float normalizeBend(int bendValue) +{ + return std::min(std::max(static_cast(bendValue), -8192.0f), 8192.0f) / 8192.0f; +} + /** * @brief Normalize a possibly negative percentage between -1 and 1 *