From: Robin Gareus Date: Sun, 16 Apr 2017 21:48:06 +0000 (+0200) Subject: FP8: limit fader range X-Git-Tag: 5.9~439 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;ds=sidebyside;h=029e963fb52aed721579e82ebf95fe994a6ba8b0;p=ardour.git 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) --- 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) {