Browse Source

Correctly handle negative MIDI CC values in MIDI-CC.

tags/v1.0.0
Andrew Belt 5 years ago
parent
commit
a2b9383933
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      src/Core/MIDI_CC.cpp

+ 3
- 1
src/Core/MIDI_CC.cpp View File

@@ -89,7 +89,9 @@ struct MIDI_CC : Module {
}
// Allow CC to be negative if the 8th bit is set.
// The gamepad driver abuses this, for example.
values[cc] = clamp(msg.data2, -127, 127);
// Cast uint8_t to int8_t
int8_t value = msg.data2;
values[cc] = clamp(value, -127, 127);
}

json_t *dataToJson() override {


Loading…
Cancel
Save