diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-10-02 10:22:00 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-10-02 10:22:00 -0400 |
commit | 918133a342252cc8c27ea6dd5890cca084f5cb30 (patch) | |
tree | 2c5024ec222c2c4bdf16f45f7207655585a574a6 /libs/surfaces/mackie/fader.cc | |
parent | 71bf231199ae41daa9ee9521303158cb0b6a35bb (diff) |
fix handler of fader (pitchbend) messages in Mackie Control so that the outbound messages match the inbound ones
Pitch bend values really can span 0 to 16384, not 16383
Diffstat (limited to 'libs/surfaces/mackie/fader.cc')
-rw-r--r-- | libs/surfaces/mackie/fader.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libs/surfaces/mackie/fader.cc b/libs/surfaces/mackie/fader.cc index cc43bf3387..46e46cf797 100644 --- a/libs/surfaces/mackie/fader.cc +++ b/libs/surfaces/mackie/fader.cc @@ -19,6 +19,10 @@ #include <cmath> +#include "pbd/compose.h" + +#include "ardour/debug.h" + #include "fader.h" #include "surface.h" #include "control_group.h" @@ -26,6 +30,7 @@ using namespace ArdourSurface; using namespace Mackie; +using namespace PBD; Control* Fader::factory (Surface& surface, int id, const char* name, Group& group) @@ -54,6 +59,7 @@ Fader::update_message () return MidiByteArray(); } - int posi = lrintf (0x3fff * position); + int posi = lrintf (16384.0 * position); + DEBUG_TRACE (DEBUG::MackieControl, string_compose ("generate fader message for position %1 (%2)\n", position, posi)); return MidiByteArray (3, 0xe0 + id(), posi & 0x7f, posi >> 7); } |