Remove a helper; no clamping for normalizePercent

This commit is contained in:
Paul Ferrand 2020-02-10 00:18:11 +01:00
parent 04779965b8
commit ccbcf4a4c7

View file

@ -71,7 +71,7 @@ constexpr float normalizeVelocity(T velocity)
template<class T>
constexpr float normalizePercents(T percentValue)
{
return std::min(std::max(static_cast<float>(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<class T>
constexpr float normalizeNegativePercents(T percentValue)
{
return std::min(std::max(static_cast<float>(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.
*