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:
parent
d366b49447
commit
9398a6f60a
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user