Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow large SysEx Messages to be broken up into smaller packets when transmitted #337

Merged
merged 2 commits into from
Apr 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading