micdah / RtMidi.Core

RtMidi for .Net Standard
https://rtmidicore.micdah.dk/
Other
36 stars 12 forks source link

RtMidiInputDevice: don't ignore SysEx #17

Closed mat1jaczyyy closed 6 years ago

mat1jaczyyy commented 6 years ago

With this change, RtMidi is instructed not to ignore SysEx messages. This allows for SysEx input to function as intended. Resolves #16.

micdah commented 6 years ago

That is a great find!

Just to make sure, I dug up what the default values are in rtmidi for midiSysex, midiTime and midiSense types - just to make sure that we are not changing default values for the other two.

This is the implementation of said C++ method:

void MidiInApi :: ignoreTypes( bool midiSysex, bool midiTime, bool midiSense )
{
  inputData_.ignoreFlags = 0;
  if ( midiSysex ) inputData_.ignoreFlags = 0x01;
  if ( midiTime ) inputData_.ignoreFlags |= 0x02;
  if ( midiSense ) inputData_.ignoreFlags |= 0x04;
}

And I found the default value here:

RtMidiInData()
  : ignoreFlags(7), doInput(false), firstMessage(true),
      apiData(0), usingCallback(false), userCallback(0), userData(0),
      continueSysex(false) {}
  };

So it is initialized with the value 7 meaning the three bit flags are all set by default (7 dec = 0x00000111) - so setting them to be ignored seems to be the correct case.

micdah commented 6 years ago

@mat1jaczyyy I have created fix-release 1.0.48.1 and it should be available shortly on nuget.org. https://rtmidicore.micdah.dk/changelog#1-0-48-1 https://www.nuget.org/packages/RtMidi.Core/1.0.48.1

mat1jaczyyy commented 6 years ago

Nice, thanks!