Added a helper to normalize bend ranges
This commit is contained in:
parent
a1282ff193
commit
db3b85e941
1 changed files with 11 additions and 0 deletions
|
|
@ -87,6 +87,17 @@ inline constexpr float normalizePercents(T percentValue)
|
|||
return std::min(std::max(static_cast<float>(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<float>(bendValue), -8192.0f), 8192.0f) / 8192.0f;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Normalize a possibly negative percentage between -1 and 1
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue