From d9af50449d31494e2d754085d1e0c8ca45554f86 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 7 Nov 2025 09:15:53 -0700 Subject: [PATCH] play transposed notes/chords (if requested) --- gtk2_ardour/midi_view.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gtk2_ardour/midi_view.cc b/gtk2_ardour/midi_view.cc index a219df1e84..054620459e 100644 --- a/gtk2_ardour/midi_view.cc +++ b/gtk2_ardour/midi_view.cc @@ -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 > 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