Skip to content

[BUG]: SDK MidiMessageConverter seems to lose group index #947

Closed

Description

Reported by Jared from MOTU on Discord:

I did actually just find and confirm the bug, it looks like MidiMessageConverter::ConvertMidi1Message is losing the MIDI group

I confirmed it with this quick and dirty code snippet pasted into one of the sample projects - as I understand it these two messages should be identical:

int msg0 = 0xB0;
int status = 0x0B;
int channel = 0x0;
int msg1 = 0x3C;
int msg2 = 01;

auto msg = MidiMessageBuilder::BuildMidi1ChannelVoiceMessage(0, MidiGroup(2), Midi1ChannelVoiceMessageStatus(status), MidiChannel(channel), msg1, msg2);
std::cout << "Good message - Word 0:            0x" << std::hex << msg.Word0() << std::endl;
auto badmsg = MidiMessageConverter::ConvertMidi1Message(0, MidiGroup(2), msg0, msg1, msg2);
std::cout << "Bad message - Word 0:            0x" << std::hex << badmsg.Word0() << std::endl;

Activity

  1. Psychlist1972 commented on Mar 28, 2026

    @Psychlist1972
    Collaborator

    Found the bug here. Thank you

    Changed

    inline void SetGroupIndexInFirstWord(_Inout_ std::uint32_t firstWord, _In_ std::uint8_t groupIndex) noexcept

    to this

    // this is only called from SDK code, so doesn't need CFR wrapping
    inline void SetGroupIndexInFirstWord(_Inout_ std::uint32_t& firstWord, _In_ std::uint8_t groupIndex) noexcept

    The reference operator was missing in the old definition, so the changes were discarded.

    Pete
    Microsoft

  2. Psychlist1972 commented on Apr 12, 2026

    @Psychlist1972
    Collaborator

    Now available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions