Add Sample Clip Fading
Adds the ability to fade the start and end of samples.
This PR does a similar thing as #5616, though admittedly much simpler. I currently only have sqrt curves, and the sample drawing does not update as you drag (this may be difficult given that we now use sample thumbnails?)
But, the main benefit is that this PR has no merge conflicts.
How to use
Mouse over the top corner of a sample clip, and a little circle handle will appear. You can drag that around to change the length of the fade. If you have a selection of sample clips, the fade will be applied to all of them.
https://github.com/user-attachments/assets/f9a3516a-38c3-42b9-bc62-524fe0627032
https://github.com/user-attachments/assets/d58244c1-3485-4349-9a0d-526e6c7c9e89
PS, I originally planned for this PR to include auto-crossfading, but I have since removed that feature. Should I rename everything to just "fade" instead of "crossfade"?
How hard would it be to add a tension dot? What I mean by this is that the curve looks fine but what if I want to change the shape of the curve? Maybe you could add a point in the middle of the curve to change the tension. If you can do this, it would be amazing.
How hard would it be to add a tension dot? What I mean by this is that the curve looks fine but what if I want to change the shape of the curve? Maybe you could add a point in the middle of the curve to change the tension. If you can do this, it would be amazing.
I've implement something like this in the latest commit. Basically instead of having a hardcoded square root curve, the height of the tension dot now determines the power.
This does mean that I have to raise a number a power every frame. I'm currently using fastPow to do this, which may not be perfectly accurate, but for fading clips it probably doesn't matter too much?
~~I find this PR to be quite laggy, especially when scrolling in the song editor~~
I just did a basic chop and faded them out, and it feels really choppy and sluggish to scroll from left to right.
Edit: turns out it's the same on master. Its because I increased the height of the track. The amount of slices seems to play a part too, but when the track is on default height there's no lag