[bug] midiKeyboardComponent


#1

using the git tip from yesterday.

midiKeyboardcomponent has a bug when using vertical view;
in the function:

int MidiKeyboardComponent::remappedXYToNote (int x, int y, float& mousePositionVelocity) const {

there is allways mousePositionVelocity = y / (float)getHeight();
used

[code] for (int octaveStart = 12 * (rangeStart / 12); octaveStart <= rangeEnd; octaveStart += 12)
{
for (int i = 0; i < 7; ++i)
{
const int note = octaveStart + whiteNotes [i];

        if (note >= rangeStart && note <= rangeEnd)
        {
            int kx, kw;
            getKeyPos (note, kx, kw);
            kx += xOffset;

            if (x >= kx && x < kx + kw)
            {
                mousePositionVelocity = y / (float) getHeight();
                return note;
            }
        }
    }
}[/code]

for vertical viewing this should be getWidth(); otherwise the mousePositionVelocity will be wrong, especially when zooming in only half the key works :wink:

comboy


#2

doh! Thankyou! Will get that sorted out right away!