Skip to content

Commit

Permalink
Merge pull request #337 from insolace/KMI_Remove_SysEx_Format_Checks
Browse files Browse the repository at this point in the history
Allow large SysEx Messages to be broken up into smaller packets when transmitted
  • Loading branch information
garyscavone committed Apr 18, 2024
2 parents e8c8791 + df1322c commit 53809fc
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions RtMidi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1675,12 +1675,6 @@ void MidiOutCore :: sendMessage( const unsigned char *message, size_t size )
return;
}

if ( message[0] != 0xF0 && nBytes > 3 ) {
errorString_ = "MidiOutCore::sendMessage: message format problem ... not sysex but > 3 bytes?";
error( RtMidiError::WARNING, errorString_ );
return;
}

MIDITimeStamp timeStamp = AudioGetCurrentHostTime();
CoreMidiData *data = static_cast<CoreMidiData *> (apiData_);
OSStatus result;
Expand Down Expand Up @@ -3148,7 +3142,7 @@ void MidiOutWinMM :: sendMessage( const unsigned char *message, size_t size )

MMRESULT result;
WinMidiData *data = static_cast<WinMidiData *> (apiData_);
if ( message[0] == 0xF0 ) { // Sysex message
if ( nBytes > 3 ) { // Sysex message

// Allocate buffer for sysex data.
char *buffer = (char *) malloc( nBytes );
Expand Down Expand Up @@ -3189,13 +3183,6 @@ void MidiOutWinMM :: sendMessage( const unsigned char *message, size_t size )
}
else { // Channel or system message.

// Make sure the message size isn't too big.
if ( nBytes > 3 ) {
errorString_ = "MidiOutWinMM::sendMessage: message size is greater than 3 bytes (and not sysex)!";
error( RtMidiError::WARNING, errorString_ );
return;
}

// Pack MIDI bytes into double word.
DWORD packet;
unsigned char *ptr = (unsigned char *) &packet;
Expand Down

0 comments on commit 53809fc

Please sign in to comment.