-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update patterns in song editor after shifting their notes by semitones in piano roll. #3961
Conversation
src/gui/editors/PianoRoll.cpp
Outdated
@@ -961,6 +961,8 @@ void PianoRoll::shiftSemiTone( int amount ) // shift notes by amount semitones | |||
} | |||
} | |||
|
|||
m_pattern->dataChanged(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to call m_pattern->rearrangeAllNotes();
before dataChanged()
as you may have moved the note past another note so they need to be sorted again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand it correctly, m_pattern->rearrangeAllNotes()
is for sorting notes by start time, but the main function shiftSemiTone
doesn't affect the notes' start time (horizontal position), it only affects the notes' keys (vertical position), so m_pattern->rearrangeAllNotes()
isn't needed, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong. I changed this recently because the notes need to be sorted by key in order for the arpeggiator to work. Otherwise the order of execution will be random. Fixed here: #3881
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, done in 31d3255.
…s in piano roll. (#3961) After shifting notes up/down, call rearrangeAllNotes() to sort notes and dataChanged() to update the pattern the Song Editor.
Backported to stable-1.2 in 43ae3c6 |
…s in piano roll. (LMMS#3961) After shifting notes up/down, call rearrangeAllNotes() to sort notes and dataChanged() to update the pattern the Song Editor.
…s in piano roll. (LMMS#3961) After shifting notes up/down, call rearrangeAllNotes() to sort notes and dataChanged() to update the pattern the Song Editor.
Fixes that shifting notes by semitones in piano roll doesn't update their pattern in song editor, by adding a call to
m_pattern->dataChanged()
inPianoRoll::shiftSemiTone()
.