Browse Source

Round MIDI CC value

tags/v1.0.0
Andrew Belt 6 years ago
parent
commit
732c1f104a
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/gamepad.cpp

+ 1
- 1
src/gamepad.cpp View File

@@ -22,7 +22,7 @@ void GamepadInputDevice::step() {
ccs.resize(numAxes);
for (int i = 0; i < numAxes; i++) {
// Allow CC value to go negative, but clamp at -127 instead of -128 for symmetry
int8_t cc = clamp((int) (axes[i] * 127), -127, 127);
int8_t cc = clamp((int) roundf(axes[i] * 127), -127, 127);
if (cc != ccs[i]) {
ccs[i] = cc;



Loading…
Cancel
Save