mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-19 15:52:53 +00:00
Use int16_t max for pitch dumping and loading
This commit is contained in:
parent
1fc31b8c44
commit
1774001598
@ -142,7 +142,7 @@ namespace
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
value = static_cast<uint16_t>(CentToHertz(centValue) * static_cast<float>(std::numeric_limits<uint16_t>::max()));
|
value = static_cast<uint16_t>(CentToHertz(centValue) * static_cast<float>(std::numeric_limits<int16_t>::max()));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -404,7 +404,7 @@ namespace
|
|||||||
|
|
||||||
void WriteColumnPitchHertz(CsvOutputStream& stream, const uint16_t value)
|
void WriteColumnPitchHertz(CsvOutputStream& stream, const uint16_t value)
|
||||||
{
|
{
|
||||||
const auto hertz = static_cast<float>(value) / static_cast<float>(std::numeric_limits<uint16_t>::max());
|
const auto hertz = static_cast<float>(value) / static_cast<float>(std::numeric_limits<int16_t>::max());
|
||||||
const auto cents = std::clamp(HertzToCents(hertz), -2400.0f, 1200.0f);
|
const auto cents = std::clamp(HertzToCents(hertz), -2400.0f, 1200.0f);
|
||||||
stream.WriteColumn(std::format("{:.4g}", cents));
|
stream.WriteColumn(std::format("{:.4g}", cents));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user