1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Added an assertion to MidiMessage to help catch float/int parameter confusion

This commit is contained in:
jules 2017-02-23 16:40:52 +00:00
parent 8011ce4209
commit 69297d6790

View file

@ -44,6 +44,9 @@ namespace MidiHelpers
//==============================================================================
uint8 MidiMessage::floatValueToMidiByte (const float v) noexcept
{
jassert (v >= 0 && v <= 1.0f); // if your value is > 1, maybe you're passing an
// integer value to a float method by mistake?
return MidiHelpers::validVelocity (roundToInt (v * 127.0f));
}