13
0

Fix generic MIDI encoder off by one

Increment for CC values > 0x40, decrement control for values <= 40.
 - 0x41 increment by one
 - 0x40 decrement by one

previously: 0x3f decremented by one, 0x3e by two, .. 0x00 by 64,
but 0x40 also by 64.
This commit is contained in:
Robin Gareus 2020-06-06 17:10:31 +02:00
parent d366b49447
commit 9398a6f60a
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -382,7 +382,7 @@ MIDIControllable::midi_sense_controller (Parser &, EventTwoBytes *msg)
if (msg->value > 0x40) {
_controllable->set_value (midi_to_control (last_value + offset + 1), Controllable::UseGroup);
} else {
_controllable->set_value (midi_to_control (last_value - (0x40 - offset)), Controllable::UseGroup);
_controllable->set_value (midi_to_control (last_value - (0x41 - msg->value)), Controllable::UseGroup);
}
break;
default: