Make note octave highlight in piano roll obey microtonality (#6663)
This commit is contained in:
@@ -149,6 +149,8 @@ public:
|
||||
{
|
||||
return m_midiClip != nullptr;
|
||||
}
|
||||
|
||||
int trackOctaveSize() const;
|
||||
|
||||
Song::PlayModes desiredPlayModeForAccompany() const;
|
||||
|
||||
|
||||
@@ -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<int> PianoRoll::getAllOctavesForKey( int keyToMirror ) const
|
||||
{
|
||||
QList<int> 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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user