Skip to content

Commit

Permalink
-Windows, use SysEx send method for all messages > 3 bytes without ch…
Browse files Browse the repository at this point in the history
…ecking for SysEx Start Message (RtMIDI should handle transport, it should not police message formatting)
  • Loading branch information
insolace committed Apr 9, 2024
1 parent 4ef7340 commit df1322c
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions RtMidi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3142,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 @@ -3183,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 df1322c

Please sign in to comment.