From 58522e5b5ea72896c2893c00bd4cf2939b30a492 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 30 Apr 2014 10:10:06 -0400 Subject: fix for storing 14 bit MIDI controller values --- libs/midi++2/channel.cc | 5 +++-- 1 file 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; -- cgit v1.2.3