Merge pull request #124 from insolace/master

::send ignores realtime messages, quick fix
This commit is contained in:
Francois Best 2019-08-22 08:52:06 +02:00 committed by GitHub
commit 2ffbdef8da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 8 deletions

View File

@ -135,16 +135,15 @@ void MidiInterface<SerialPort, Settings>::send(MidiType inType,
DataByte inData2, DataByte inData2,
Channel inChannel) Channel inChannel)
{ {
// Then test if channel is valid
if (inChannel >= MIDI_CHANNEL_OFF ||
inChannel == MIDI_CHANNEL_OMNI ||
inType < 0x80)
{
return; // Don't send anything
}
if (inType <= PitchBend) // Channel messages if (inType <= PitchBend) // Channel messages
{ {
// Then test if channel is valid
if (inChannel >= MIDI_CHANNEL_OFF ||
inChannel == MIDI_CHANNEL_OMNI ||
inType < 0x80)
{
return; // Don't send anything
}
// Protection: remove MSBs on data // Protection: remove MSBs on data
inData1 &= 0x7f; inData1 &= 0x7f;
inData2 &= 0x7f; inData2 &= 0x7f;