diff options
author | Robin Gareus <robin@gareus.org> | 2017-04-16 23:48:06 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-04-16 23:48:06 +0200 |
commit | 029e963fb52aed721579e82ebf95fe994a6ba8b0 (patch) | |
tree | 977b08dab132e2695d196d2b4509326609e395e4 /libs/surfaces/faderport8/fp8_strip.cc | |
parent | 55cd96df8dd6edbe9b3603b3dc3de6b53d185fd4 (diff) |
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)
Diffstat (limited to 'libs/surfaces/faderport8/fp8_strip.cc')
-rw-r--r-- | libs/surfaces/faderport8/fp8_strip.cc | 1 |
1 files changed, 1 insertions, 0 deletions
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) { |