mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
push2: make octave buttons actually work, with shift-press to reset to zero
This commit is contained in:
parent
6b080bf6ec
commit
c4602603b4
2 changed files with 11 additions and 3 deletions
|
|
@ -503,20 +503,28 @@ Push2::start_press_timeout (Button& button, ButtonID id)
|
|||
void
|
||||
Push2::button_octave_down ()
|
||||
{
|
||||
if (_modifier_state & ModShift) {
|
||||
octave_shift = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
int os = (max (-4, octave_shift - 1));
|
||||
if (os != octave_shift) {
|
||||
octave_shift = os;
|
||||
build_pad_table ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Push2::button_octave_up ()
|
||||
{
|
||||
if (_modifier_state & ModShift) {
|
||||
octave_shift = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
int os = (min (4, octave_shift + 1));
|
||||
if (os != octave_shift) {
|
||||
octave_shift = os;
|
||||
build_pad_table ();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1256,7 +1256,7 @@ Push2::pad_filter (MidiBuffer& in, MidiBuffer& out) const
|
|||
Pad const * pad = nni->second;
|
||||
/* shift for output to the shadow port */
|
||||
if (pad->filtered >= 0) {
|
||||
(*ev).set_note (pad->filtered);
|
||||
(*ev).set_note (pad->filtered + (octave_shift*12));
|
||||
out.push_back (*ev);
|
||||
/* shift back so that the pads light correctly */
|
||||
(*ev).set_note (n);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue