enforce a 1 octave minimum note range in MidiViews

May revisit this to allow less in the future
This commit is contained in:
Paul Davis
2025-04-28 08:58:25 -06:00
parent 747be87974
commit 975b01060a

View File

@@ -255,6 +255,14 @@ MidiViewBackground::apply_note_range (uint8_t lowest, uint8_t highest, bool to_c
{
bool changed = false;
/* Enforce a 1 octave minimum */
if (highest - lowest < 12) {
int8_t mid = lowest + ((highest - lowest) / 2);
lowest = std::max (mid - 6, 0);
highest = lowest + 12;
}
if (_highest_note != highest) {
_highest_note = highest;
changed = true;