From 8629aea237fd136846f894829a7010582d9b1f72 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 21 Apr 2023 17:20:17 -0600 Subject: [PATCH] push2: shift held while using touch strip sends modulation, not pitch bend --- libs/surfaces/push2/push2.cc | 16 ++++++---------- libs/surfaces/push2/push2.h | 2 +- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/libs/surfaces/push2/push2.cc b/libs/surfaces/push2/push2.cc index 23976379b2..b293d0eedd 100644 --- a/libs/surfaces/push2/push2.cc +++ b/libs/surfaces/push2/push2.cc @@ -197,7 +197,7 @@ Push2::begin_using_device () vblank_timeout->attach (main_loop()->get_context()); init_buttons (true); - init_touch_strip (); + init_touch_strip (false); reset_pad_colors (); splash (); @@ -414,16 +414,10 @@ Push2::set_active (bool yn) } void -Push2::init_touch_strip () +Push2::init_touch_strip (bool shift) { - MidiByteArray msg (9, 0xf0, 0x00, 0x21, 0x1d, 0x01, 0x01, 0x17, 0x00, 0xf7); - /* flags are the final byte (ignore end-of-sysex */ - - /* show bar, not point - autoreturn to center - bar starts at center - */ - msg[7] = (1<<4) | (1<<5) | (1<<6); + const int bits = (shift ? 0xc : 0x68); + const MidiByteArray msg (9, 0xf0, 0x00, 0x21, 0x1d, 0x01, 0x01, 0x17, bits, 0xf7); write (msg); } @@ -885,6 +879,7 @@ Push2::start_shift () b->set_color (LED::White); b->set_state (LED::Blinking16th); write (b->state_msg()); + init_touch_strip (true); } void @@ -897,6 +892,7 @@ Push2::end_shift () b->set_color (LED::White); b->set_state (LED::OneShot24th); write (b->state_msg()); + init_touch_strip (false); } } diff --git a/libs/surfaces/push2/push2.h b/libs/surfaces/push2/push2.h index 93788425f3..686857070d 100644 --- a/libs/surfaces/push2/push2.h +++ b/libs/surfaces/push2/push2.h @@ -470,7 +470,7 @@ class Push2 : public MIDISurface void start_press_timeout (std::shared_ptr