summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-05-04 23:33:27 +0200
committerRobin Gareus <robin@gareus.org>2019-05-05 02:49:53 +0200
commit5bde8f44560e0dc2ceca8e70f5e76ddfdd41b5bc (patch)
tree353dd9bc1be09b514244f640357b433bcd8ca75d
parent7e7ca24f8fb9c905a7e0ef4706db6098b2abf066 (diff)
Tweak initial generic-midi sync/smoothing
"last_controllable_value" is using midi value range (0..127). It is used to compare received midi-value with the actual controllable for non-motorized surfaces, and this change allows the first event to already be in_sync. Previously the first MIDI-event was usually ignored (because last_controllable_value was out of bounds or didn't match the 0..127 range.
-rw-r--r--libs/surfaces/generic_midi/midicontrollable.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/surfaces/generic_midi/midicontrollable.cc b/libs/surfaces/generic_midi/midicontrollable.cc
index ee08bd70a9..b06a39d7a2 100644
--- a/libs/surfaces/generic_midi/midicontrollable.cc
+++ b/libs/surfaces/generic_midi/midicontrollable.cc
@@ -136,7 +136,7 @@ MIDIControllable::set_controllable (boost::shared_ptr<PBD::Controllable> c)
if (c) {
_controllable = c;
- last_controllable_value = c->get_value();
+ last_controllable_value = control_to_midi (c->get_value());
} else {
_controllable.reset();
last_controllable_value = 0.0f; // is there a better value?