LMMS / lmms

Cross-platform music production software
https://lmms.io
GNU General Public License v2.0
8.18k stars 1.01k forks source link

Smarter fill #7565

Closed allejok96 closed 2 weeks ago

allejok96 commented 3 weeks ago

Hey guys :cat:

I wanted to keep this PR simple, because I don't want this to end like the last time... But the PR turned out quite big somehow, so sorry if it's a lot to review. If you can, just give it a test ride.


Don't fill notes that overlap slightly

Fill removes gaps between notes by extending their endpoints to the next note. But currently if it overlaps the next note, it will be extended until yet another note starts. In this example the last bar should not be filled:

bild

Here's the logic I implemented.

bild

If you don't agree on the percentage, keep in mind that the current code fills if it overlaps more than 0%.

Fill selected notes independently

Imagine you wanted to extend the chords below. Before you couldn't, because they would interfere with the melody. Now you can by pressing Fill twice.

https://github.com/user-attachments/assets/f927a35b-50d4-4a5f-a0d7-33b843030190

The popup is only shown if filling a second time would have effect.

Cut overlaps of selected notes

Since I had to redo the Cut overlaps code for this PR, I decided to implement the same feature there. The first cut will be with respect to the selected notes only, the second cut the notes more so they don't overlap any other note (this is the default behavior right now).

allejok96 commented 2 weeks ago

I'm breaking this PR into smaller chunks for easier review, starting with #7569