Apologies if this has been mentioned already. I didn’t see anything about it. The midi keyboard in the plug in host triggers a jassert runtime error on occasion. It seems to trigger most often if you slide the mouse back and forth across the keys near the top of the keyboard. Seems to be linked to velocity. Not sure how urgent this is, just thought I’d mention it.
daniel
April 8, 2018, 12:56am
2
just adding the second screenshot @acanois posted in “theAudioProgrammer” discord:
Seems like MidiMessage::floatValueToMidiByte() is used to convert the velocity, and it asserts here:
inline uint8 validVelocity (const int v) noexcept
{
return (uint8) jlimit (0, 127, v);
}
}
//==============================================================================
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));
}
uint16 MidiMessage::pitchbendToPitchwheelPos (const float pitchbend,
const float pitchbendRange) noexcept
{
// can't translate a pitchbend value that is outside of the given range!
jassert (std::abs (pitchbend) <= pitchbendRange);
And since the velocity was triggered from the MidiKeyboardComponent, I think this is the place to look at:
if (note >= rangeStart && note <= rangeEnd)
{
if (getKeyPos (note).contains (pos.x - xOffset))
{
mousePositionVelocity = jmax (0.0f, pos.y / blackNoteLength);
return note;
}
}
}
}
}
for (int octaveStart = 12 * (rangeStart / 12); octaveStart <= rangeEnd; octaveStart += 12)
{
for (int i = 0; i < 7; ++i)
{
auto note = octaveStart + whiteNotes[i];
if (note >= rangeStart && note <= rangeEnd)
{
if (getKeyPos (note).contains (pos.x - xOffset))
I don’t know how pos.y could be either negative or greater than whiteNoteLength…
Thanks for the extended description.
fr810
April 23, 2018, 10:35am
4
Thanks for reporting. I’ll get this sorted.