Truncate MIDI values when denormalizing

This commit is contained in:
essej 2024-01-18 21:38:49 +01:00 committed by Paul Ferrand
parent bb50adc882
commit df0806f157

View file

@ -150,7 +150,7 @@ struct OpcodeSpec
else if (flags & kNormalizePercent) else if (flags & kNormalizePercent)
return static_cast<U>(input * U(100)); return static_cast<U>(input * U(100));
else if (flags & kNormalizeMidi) else if (flags & kNormalizeMidi)
return static_cast<U>(input * U(127)); return static_cast<U>(std::trunc(input * U(127)));
else if (flags & kNormalizeBend) else if (flags & kNormalizeBend)
return static_cast<U>(input * U(8191)); return static_cast<U>(input * U(8191));
else if (flags & kDb2Mag) else if (flags & kDb2Mag)