atsushieno / managed-midi

[Past project] Cross-platform MIDI processing library for mono and .NET (ALSA, CoreMIDI, Android, WinMM and UWP).
MIT License
194 stars 26 forks source link

UWP - Error in reading channel from status byte #69

Open usagi64 opened 3 years ago

usagi64 commented 3 years ago

In method UwpMidiOutput.Convert(byte[], int, int, long) the channel for the new MidiNoteOnMessage and MidiNoteOffMessage is calculated by (byte)(mevent [i] & 0x7F) instead of (byte)(mevent [i] & 0x0F)

https://github.com/atsushieno/managed-midi/blob/master/Commons.Music.Midi.UwpShared/UwpMidiAccess.cs#L195 https://github.com/atsushieno/managed-midi/blob/master/Commons.Music.Midi.UwpShared/UwpMidiAccess.cs#L195

Here it is ok: Commons.Music.Midi.Shared/SMF.cs https://github.com/atsushieno/managed-midi/blob/master/Commons.Music.Midi.Shared/SMF.cs#L405 public byte Channel { get { return (byte) (Value & 0x0F); } }