Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add "rearrangeAllNotes()" before "dataChanged()".
  • Loading branch information
Hussam Eddin Alhomsi committed Nov 9, 2017
commit 31d32552964f80f0c303a47059f245d397cff287
1 change: 1 addition & 0 deletions src/gui/editors/PianoRoll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,7 @@ void PianoRoll::shiftSemiTone( int amount ) // shift notes by amount semitones
}
}

m_pattern->rearrangeAllNotes();
m_pattern->dataChanged();
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.


// we modified the song
Expand Down