From 029e963fb52aed721579e82ebf95fe994a6ba8b0 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 16 Apr 2017 23:48:06 +0200 Subject: [PATCH] FP8: limit fader range In case of VCA masters or otherwise the value can exceed the max +6dB and internal_to_interface() returns a value > 1.0 which cannot be represented on the physical fader (MIDI &0x7f wraps) --- libs/surfaces/faderport8/fp8_strip.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/surfaces/faderport8/fp8_strip.cc b/libs/surfaces/faderport8/fp8_strip.cc index 3bedf0e85c..a0a3b82457 100644 --- a/libs/surfaces/faderport8/fp8_strip.cc +++ b/libs/surfaces/faderport8/fp8_strip.cc @@ -360,6 +360,7 @@ FP8Strip::notify_fader_changed () float val = 0; if (ac) { val = ac->internal_to_interface (ac->get_value()) * 16368.f; /* 16 * 1023 */ + val = std::max (0.f, std::min (1.f, val)); } unsigned short mv = lrintf (val); if (mv == _last_fader) {