Hi guys,
Since updating to juce, I get some assert
jassert (note >= rangeStart && note <= rangeEnd);
I display the whole keyboard hence KeyboardComponentBase::paint
call the whole range
**for** ( **int** octaveBase = 0; octaveBase < 128; octaveBase += 12)
so when I’m at octaveBase of 120 then the
drawWhiteKey (octaveBase + noteNum, g, getRectangleForKey (octaveBase + noteNum));
call getRectangleForKey for value > 128
Thanks !
Q&D fix
void KeyboardComponentBase::paint (Graphics& g)
{
drawKeyboardBackground (g, getLocalBounds().toFloat());
for (int octaveBase = 12 * (rangeStart / 12); octaveBase <= rangeEnd; octaveBase += 12)
{
for (auto noteNum : whiteNotes)
if (octaveBase + noteNum >= rangeStart && octaveBase + noteNum <= rangeEnd)
drawWhiteKey (octaveBase + noteNum, g, getRectangleForKey (octaveBase + noteNum));
for (auto noteNum : blackNotes)
if (octaveBase + noteNum >= rangeStart && octaveBase + noteNum <= rangeEnd)
drawBlackKey (octaveBase + noteNum, g, getRectangleForKey (octaveBase + noteNum));
}
}
but the best is to probably rewrite it
tagging @ed95 as it is his code
reuk
January 25, 2022, 6:21pm
4
Thanks for reporting. Should be fixed here:
committed 05:27PM - 25 Jan 22 UTC
I wanted to make a quick post here to say that I am going to be leaving the JUCE team at the end of this month and to reflect a little on my time working on the team.
It’s hard to believe that this post is from 5 1/2 years ago! Time flies when you’re fixing bugs.
When I joined the team in 2016, JUCE was in a very different place. In the intervening years the team has grown and changed; we’ve moved companies, offices, and pushed a lot of code (alongside a few bugs here and there…). However th…
1 Like