summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-04-30 10:10:06 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2014-04-30 10:10:06 -0400
commit58522e5b5ea72896c2893c00bd4cf2939b30a492 (patch)
tree700c940636e5d8d5dd208ccc0ed487f44f15364e
parent8a6762f189680a7ae6d2060aab97be0c43ae227a (diff)
fix for storing 14 bit MIDI controller values
-rw-r--r--libs/midi++2/channel.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/midi++2/channel.cc b/libs/midi++2/channel.cc
index 190ea18568..67d6f5fb11 100644
--- a/libs/midi++2/channel.cc
+++ b/libs/midi++2/channel.cc
@@ -138,7 +138,9 @@ Channel::process_controller (Parser & /*parser*/, EventTwoBytes *tb)
} else if ((tb->controller_number >= 32 &&
tb->controller_number <= 63)) {
- cv = (unsigned short) _controller_val[tb->controller_number];
+ int cn = tb->controller_number - 32;
+
+ cv = (unsigned short) _controller_val[cn];
/* LSB for CC 0-31 arrived.
@@ -151,7 +153,6 @@ Channel::process_controller (Parser & /*parser*/, EventTwoBytes *tb)
high 7.
*/
- int cn = tb->controller_number - 32;
if (_controller_14bit[cn] == false) {
_controller_14bit[cn] = true;