Skip to content
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

Merged
merged 2 commits into from
Nov 9, 2017

Conversation

Sawuare
Copy link
Member

@Sawuare Sawuare commented Nov 9, 2017

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() in PianoRoll::shiftSemiTone().

@@ -961,6 +961,8 @@ void PianoRoll::shiftSemiTone( int amount ) // shift notes by amount semitones
}
}

m_pattern->dataChanged();
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

@zonkmachine zonkmachine Nov 9, 2017

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

Copy link
Member Author

@Sawuare Sawuare Nov 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, done in 31d3255.

@zonkmachine zonkmachine merged commit aea3394 into LMMS:master Nov 9, 2017
zonkmachine pushed a commit that referenced this pull request Nov 9, 2017
…s in piano roll. (#3961)

After shifting notes up/down, call rearrangeAllNotes() to sort notes and dataChanged()
to update the pattern the Song Editor.
@zonkmachine
Copy link
Member

Backported to stable-1.2 in 43ae3c6

@Sawuare Sawuare deleted the PR branch November 9, 2017 16:20
sdasda7777 pushed a commit to sdasda7777/lmms that referenced this pull request Jun 28, 2022
…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.
sdasda7777 pushed a commit to sdasda7777/lmms that referenced this pull request Jun 28, 2022
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants