Bug: MidiMessage::midiMachineControlGoto produces malformed 12-byte SysEx (missing sub-frames)

Although this bug was found with the help of AI i feel comfortable to post this topic, as the proposed fix works in my environment.

Title: Bug: MidiMessage::midiMachineControlGoto produces malformed 12-byte SysEx (missing sub-frames)

Description: I recently ran into an issue where MMC Locate commands generated by MidiMessage::midiMachineControlGoto were being ignored by Cubase. Upon inspecting the MIDI output, I noticed the SysEx message being generated is malformed.

The MIDI Machine Control Locate specification (Command 0x44) expects a 13-byte message: F0 7F 06 44 06 01 F7

However, the current implementation in juce_MidiMessage.cpp generates a 12-byte message:

cpp

MidiMessage MidiMessage::midiMachineControlGoto (int hours, int minutes, int seconds, int frames)
{
return { 0xf0, 0x7f, 0, 6, 0x44, 6, 1, hours, minutes, seconds, frames, 0xf7 };
}

As you can see, the function asserts a payload length of 6, but only provides 5 bytes (1, hours, minutes, seconds, frames) before terminating with 0xf7. The 5th timecode byte (sub-frames) is completely missing. Strict DAWs see the mismatch between the length header and the actual byte count and drop the message.

Additionally, the Device ID is hardcoded to 0. It would be fantastic if the function could either accept the sub-frames and device ID as optional parameters, or at the very least hardcode 0 for sub-frames to make the message structurally valid.

Proposed Fix:

cpp

MidiMessage MidiMessage::midiMachineControlGoto (int hours, int minutes, int seconds, int frames, int subframes = 0, int deviceId = 0x7F)
{
return { 0xf0, 0x7f, (uint8)deviceId, 6, 0x44, 6, 1,
(uint8)hours, (uint8)minutes, (uint8)seconds, (uint8)frames, (uint8)subframes, 0xf7 };
}