projects
/
ardour.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
55cd96d
)
FP8: limit fader range
author
Robin Gareus
<robin@gareus.org>
Sun, 16 Apr 2017 21:48:06 +0000
(23:48 +0200)
committer
Robin Gareus
<robin@gareus.org>
Sun, 16 Apr 2017 21:48:06 +0000
(23:48 +0200)
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
patch
|
blob
|
history
diff --git
a/libs/surfaces/faderport8/fp8_strip.cc
b/libs/surfaces/faderport8/fp8_strip.cc
index 3bedf0e85c03d01d8d777b27050379e2c1325bd4..a0a3b8245714e396dee6948fd55bc618d4f5390e 100644
(file)
--- 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) {