lmms icon indicating copy to clipboard operation
lmms copied to clipboard

Changing BPM on sliced samples is broken

Open RoxasKH opened this issue 2 years ago • 0 comments

Bug Summary

As the title says, when you change the BPM of your song after having correctly sliced one or more samples according to your needs, will mess up with the sample, considering the start of the clip the original start of the sample and not where you sliced it/them. Having this behaviour will need a rerender of the sliced part everytime you wanna change bpm and it's not comfortable.

Steps to reproduce

  1. Open LMMS and load up a sample, then set the bpm as the sample sayd to have it playing in time.

immagine immagine

  1. Slice the sample as you please

immagine

  1. Now change the BPM of the track as you may prefer (imagining you've changed idea on how fast you want the song to be)

immagine

As you can see the end result is broken and not what you chose to slice out of the original sample.

Expected behavior

The expected behaviour can be seen in FL Studio following the same steps

Sliced sample before changing the BPM immagine

After changin the BPM immagine

Affected LMMS versions

LMMS 1.3.0 Alpha 1.102, Windows 10 Home 64bit

RoxasKH avatar Jul 19 '22 12:07 RoxasKH

Unrelated to the knife tool and duplicate of #4153

Spekular avatar Aug 19 '22 03:08 Spekular

I was going to agree with you @RoxasKH that this bug report brings to light something not mentioned in the other one...

Then I realized that @Spekular is right. Both bugs are due to SampleClip storing it's length and offset as a TimePos. A TimePos is affected by BPM, but it stays constant in relation to the rest of the song.

If sample clip instead stored it's length and offset as number of sample frames it would stay constant in relation to the sample itself, but vary in relation to the rest of the song.

Probably the easiest solution would be to just recalculate these two values on a BPM change.

allejok96 avatar Sep 01 '22 15:09 allejok96