Bug for receiving MIDI SysEx


#1

Hi Jules,

In the function processSysex() in juce_mac_CoreMidi.cpp,

[code] while (size > 0)
{
if (mpe->pendingBytes > 0 && *d >= 0x80)
{
if (*d >= 0xfa || *d == 0xf8)
{
mpe->callback->handleIncomingMidiMessage (mpe->input, MidiMessage (*d, time));
++d;
–size;
}
else
{
if (*d == 0xf7)
{
*dest++ = *d++;
mpe->pendingBytes++;
–size;
}

            break;
        }
    }
    *dest++ = *d++;
    mpe->pendingBytes++;
    --size;
}[/code]

should be

[code] while (size > 0)
{
if (mpe->pendingBytes > 0 && *d >= 0x80)
{
if (*d >= 0xfa || *d == 0xf8)
{
mpe->callback->handleIncomingMidiMessage (mpe->input, MidiMessage (*d, time));
++d;
–size;
}
else
{
if (*d == 0xf7)
{
*dest++ = *d++;
mpe->pendingBytes++;
–size;
}

            break;
        }
    }
    else {
        *dest++ = *d++;
        mpe->pendingBytes++;
        --size;
    }
}[/code]

sorry for my checking was not perfect…

Masa


#2

Ah - well spotted! thanks!


#3