play transposed notes/chords (if requested)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user