diff --git a/include/PianoRoll.h b/include/PianoRoll.h index 23fe7ddc6..25b4166c4 100644 --- a/include/PianoRoll.h +++ b/include/PianoRoll.h @@ -149,6 +149,8 @@ public: { return m_midiClip != nullptr; } + + int trackOctaveSize() const; Song::PlayModes desiredPlayModeForAccompany() const; diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index d4781eccd..b5a7e74b0 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -600,7 +600,7 @@ void PianoRoll::markSemiTone(int i, bool fromMenu) const int first = chord->isScale() ? 0 : key; const int last = chord->isScale() ? NumKeys : key + chord->last(); - const int cap = ( chord->isScale() || chord->last() == 0 ) ? KeysPerOctave : chord->last(); + const int cap = (chord->isScale() || chord->last() == 0) ? trackOctaveSize() : chord->last(); for( int i = first; i <= last; i++ ) { @@ -937,6 +937,14 @@ void PianoRoll::hideMidiClip( MidiClip* clip ) } } + +int PianoRoll::trackOctaveSize() const +{ + auto ut = m_midiClip->instrumentTrack()->microtuner(); + return ut->enabled() ? ut->octaveSize() : KeysPerOctave; +} + + void PianoRoll::selectRegionFromPixels( int xStart, int xEnd ) { @@ -3950,7 +3958,8 @@ QList PianoRoll::getAllOctavesForKey( int keyToMirror ) const { QList keys; - for (int i=keyToMirror % KeysPerOctave; i < NumKeys; i += KeysPerOctave) + int trackKeysPerOctave = trackOctaveSize(); + for (int i = keyToMirror % trackKeysPerOctave; i < NumKeys; i += trackKeysPerOctave) { keys.append(i); }