Fixed generic MIDI program change event size to two bytes (fixes #6426)
This commit is contained in:
parent
6349570fb2
commit
a29b050883
|
@ -470,12 +470,16 @@ MIDIControllable::write_feedback (MIDI::byte* buf, int32_t& bufsize, bool /*forc
|
||||||
DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("Feedback: %1 %2\n", control_description(), current_uri()));
|
DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("Feedback: %1 %2\n", control_description(), current_uri()));
|
||||||
|
|
||||||
*buf++ = (0xF0 & control_type) | (0xF & control_channel);
|
*buf++ = (0xF0 & control_type) | (0xF & control_channel);
|
||||||
|
int ev_size = 3;
|
||||||
switch (control_type) {
|
switch (control_type) {
|
||||||
case MIDI::pitchbend:
|
case MIDI::pitchbend:
|
||||||
*buf++ = int (gm) & 127;
|
*buf++ = int (gm) & 127;
|
||||||
*buf++ = (int (gm) >> 7) & 127;
|
*buf++ = (int (gm) >> 7) & 127;
|
||||||
break;
|
break;
|
||||||
|
case MIDI::program:
|
||||||
|
*buf++ = control_additional; /* program number */
|
||||||
|
ev_size = 2;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
*buf++ = control_additional; /* controller number */
|
*buf++ = control_additional; /* controller number */
|
||||||
*buf++ = gm;
|
*buf++ = gm;
|
||||||
|
@ -484,7 +488,7 @@ MIDIControllable::write_feedback (MIDI::byte* buf, int32_t& bufsize, bool /*forc
|
||||||
DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("MIDI out: Type %1 Channel %2 Bytes %3 %4\n", (int) control_type, (int) control_channel , (int) *(buf - 2), (int) *(buf - 1)));
|
DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("MIDI out: Type %1 Channel %2 Bytes %3 %4\n", (int) control_type, (int) control_channel , (int) *(buf - 2), (int) *(buf - 1)));
|
||||||
|
|
||||||
last_value = gm;
|
last_value = gm;
|
||||||
bufsize -= 3;
|
bufsize -= ev_size;
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user