Skip to content

Conversation

@husamalhomsi
Copy link
Member

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().

}
}

m_pattern->dataChanged();
Copy link
Contributor

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
Contributor

@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

@husamalhomsi husamalhomsi 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
Contributor

Backported to stable-1.2 in 43ae3c6

@husamalhomsi husamalhomsi 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