mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 08:14:58 +01:00
Improve step-editor chord mode: step on note-off
This commit is contained in:
parent
814fbfcb73
commit
826ad62d91
2 changed files with 14 additions and 0 deletions
|
|
@ -68,6 +68,7 @@ StepEditor::start_step_editing ()
|
|||
step_edit_region_view = 0;
|
||||
last_added_pitch = -1;
|
||||
last_added_end = Temporal::Beats();
|
||||
_tracker.reset ();
|
||||
|
||||
resync_step_edit_position ();
|
||||
prepare_step_edit_region ();
|
||||
|
|
@ -203,9 +204,19 @@ StepEditor::check_step_edit ()
|
|||
break;
|
||||
}
|
||||
|
||||
_tracker.track (buf);
|
||||
|
||||
if ((buf[0] & 0xf0) == MIDI_CMD_NOTE_ON && size == 3) {
|
||||
step_add_note (buf[0] & 0xf, buf[1], buf[2], Temporal::Beats());
|
||||
}
|
||||
|
||||
/* note-off w/chord .. move to next beat */
|
||||
if ((buf[0] & 0xf0) == MIDI_CMD_NOTE_OFF && size == 3 && _tracker.empty ()) {
|
||||
if (step_edit_region_view && _step_edit_within_chord) {
|
||||
step_edit_beat_pos += _step_edit_chord_duration;
|
||||
step_edit_region_view->move_step_edit_cursor (step_edit_beat_pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
delete [] buf;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@
|
|||
#include "temporal/beats.h"
|
||||
#include "temporal/timeline.h"
|
||||
|
||||
#include "ardour/midi_state_tracker.h"
|
||||
|
||||
namespace ARDOUR {
|
||||
class MidiTrack;
|
||||
class MidiRegion;
|
||||
|
|
@ -97,6 +99,7 @@ private:
|
|||
MidiTimeAxisView& _mtv;
|
||||
int8_t last_added_pitch;
|
||||
Temporal::Beats last_added_end;
|
||||
ARDOUR::MidiNoteTracker _tracker;
|
||||
|
||||
sigc::connection delete_connection;
|
||||
sigc::connection hide_connection;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue