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:
parent
8011ce4209
commit
69297d6790
1 changed files with 3 additions and 0 deletions
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue