From 2f25592702145ca254090b1b25d0ecd3c7e80e1a Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 8 Sep 2023 14:57:28 -0600 Subject: [PATCH] push2: add velocity sensitivity --- libs/surfaces/push2/cues.cc | 4 ++-- libs/surfaces/push2/cues.h | 2 +- libs/surfaces/push2/layout.h | 2 +- libs/surfaces/push2/push2.cc | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/surfaces/push2/cues.cc b/libs/surfaces/push2/cues.cc index 7fde023066..c1fddadbfc 100644 --- a/libs/surfaces/push2/cues.cc +++ b/libs/surfaces/push2/cues.cc @@ -569,7 +569,7 @@ CueLayout::show_running_boxen (bool yn) } void -CueLayout::pad_press (int y, int x) /* fix coordinate order one day */ +CueLayout::pad_press (int y, int x, int velocity) /* fix coordinate order one day */ { if (!_route[x]) { return; @@ -582,7 +582,7 @@ CueLayout::pad_press (int y, int x) /* fix coordinate order one day */ return; } - tb->bang_trigger_at (y + scene_base); + tb->bang_trigger_at (y + scene_base, velocity / 127.0f); } void diff --git a/libs/surfaces/push2/cues.h b/libs/surfaces/push2/cues.h index baa7172de6..f6c9ad988b 100644 --- a/libs/surfaces/push2/cues.h +++ b/libs/surfaces/push2/cues.h @@ -82,7 +82,7 @@ class CueLayout : public Push2Layout void strip_vpot (int, int); void strip_vpot_touch (int, bool); - void pad_press (int x, int y); + void pad_press (int x, int y, int velocity); void pad_release (int x, int y); /* override to use for clip progress */ diff --git a/libs/surfaces/push2/layout.h b/libs/surfaces/push2/layout.h index 950d5e75d2..7fa01ef9cf 100644 --- a/libs/surfaces/push2/layout.h +++ b/libs/surfaces/push2/layout.h @@ -68,7 +68,7 @@ class Push2Layout : public sigc::trackable, public ArdourCanvas::Container virtual void strip_vpot (int, int) = 0; virtual void strip_vpot_touch (int, bool) = 0; - virtual void pad_press (int x, int y) {} + virtual void pad_press (int x, int y, int velocity) {} virtual void pad_release (int x, int y) {} virtual void update_meters () {} diff --git a/libs/surfaces/push2/push2.cc b/libs/surfaces/push2/push2.cc index 08ea607797..dda35d97a2 100644 --- a/libs/surfaces/push2/push2.cc +++ b/libs/surfaces/push2/push2.cc @@ -655,7 +655,7 @@ Push2::handle_midi_note_on_message (MIDI::Parser& parser, MIDI::EventTwoBytes* e std::shared_ptr pad_pressed = pm->second; if (_current_layout == _cue_layout) { - _current_layout->pad_press (pad_pressed->x, pad_pressed->y); + _current_layout->pad_press (pad_pressed->x, pad_pressed->y, ev->velocity); return; }