X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=_MIDI.pde;h=4e1f20acbcf9a03bab451300007e87f394f376e7;hb=882e2e3ed34fe7867ca849b2be18cbf148b6f5b2;hp=7673f7ffd87d6cadf3630ed7abfa64efc0e50c7e;hpb=b8bb27489db7dc687bf150576e9d9439f1fa17a6;p=SugarCubes.git diff --git a/_MIDI.pde b/_MIDI.pde index 7673f7f..4e1f20a 100644 --- a/_MIDI.pde +++ b/_MIDI.pde @@ -863,7 +863,11 @@ class APC40MidiOutput implements LXParameterListener, GridOutput { } private void sendKnob(int i, LXParameter p) { - sendKnob(i, (int) (p.getValuef() * 127.)); + float pv = constrain(p.getValuef(), 0, 1); + if (p instanceof LXNormalizedParameter) { + pv = ((LXNormalizedParameter)p).getNormalizedf(); + } + sendKnob(i, (int) (pv * 127.)); } private void sendKnob(int i, int value) {