From a57dfc6a368fad81c04d1ed8031b6c880fa97a71 Mon Sep 17 00:00:00 2001 From: Mark Slee Date: Fri, 6 Dec 2013 14:53:12 -0500 Subject: [PATCH] Send normalized values back to APC40 --- _MIDI.pde | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) { -- 2.34.1