From ef8f2579c1df49b51241a0b7681c30ccc12e718e Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 17 Mar 2025 10:00:44 -0600 Subject: [PATCH] if showing an empty model in a pianoroll, set the visible channel to 1 --- gtk2_ardour/midi_view.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/midi_view.cc b/gtk2_ardour/midi_view.cc index 412fc9e776..f25627897d 100644 --- a/gtk2_ardour/midi_view.cc +++ b/gtk2_ardour/midi_view.cc @@ -369,11 +369,18 @@ MidiView::set_model (std::shared_ptr m) //set_height (trackview.current_height()); if (_show_source) { - for (int n = 0; n < 16; ++n) { + int n = 0; + + while (n < 16) { if (_model->channels_present() & (1 << n)) { set_visible_channel (n); break; } + ++n; + } + + if (n == 16) { + set_visible_channel (n); } }