mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-20 20:36:01 +01:00
play transposed notes/chords (if requested)
This commit is contained in:
parent
9e1e8fd1e0
commit
d9af50449d
1 changed files with 22 additions and 0 deletions
|
|
@ -3814,6 +3814,8 @@ MidiView::change_velocities (bool up, bool fine, bool allow_smush, bool all_toge
|
|||
void
|
||||
MidiView::transpose (bool up, bool fine, bool allow_smush)
|
||||
{
|
||||
typedef vector<std::shared_ptr<NoteType> > PossibleChord;
|
||||
|
||||
if (_selection.empty()) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -3864,6 +3866,26 @@ MidiView::transpose (bool up, bool fine, bool allow_smush)
|
|||
_midi_context.maybe_extend_note_range (lowest);
|
||||
_midi_context.maybe_extend_note_range (highest);
|
||||
}
|
||||
|
||||
if (!_no_sound_notes && UIConfiguration::instance().get_sound_midi_notes()) {
|
||||
if (_selection.size() == 1) {
|
||||
start_playing_midi_note ((*(_selection.begin()))->note());
|
||||
} else {
|
||||
Temporal::Beats earliest = earliest_in_selection();
|
||||
PossibleChord to_play;
|
||||
|
||||
/* Only play the notes in the first transposed chord or
|
||||
* the earliest note.
|
||||
*/
|
||||
|
||||
for (auto & nb : _selection) {
|
||||
if (nb->note()->time() == earliest) {
|
||||
to_play.push_back (nb->note());
|
||||
}
|
||||
}
|
||||
start_playing_midi_chord (to_play);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue