Clamp the crossfade to the available samples before the loop starts
This commit is contained in:
parent
dafde79560
commit
7b42e070a2
1 changed files with 2 additions and 0 deletions
|
|
@ -1540,6 +1540,8 @@ void Voice::Impl::updateLoopInformation() noexcept
|
|||
loop_.start = static_cast<int>(region_->loopStart(factor));
|
||||
loop_.size = loop_.end + 1 - loop_.start;
|
||||
loop_.xfSize = static_cast<int>(lroundPositive(region_->loopCrossfade * rate));
|
||||
// Clamp the crossfade to the part available before the loop starts
|
||||
loop_.xfSize = min(loop_.start, loop_.xfSize);
|
||||
loop_.xfOutStart = loop_.end + 1 - loop_.xfSize;
|
||||
loop_.xfInStart = loop_.start - loop_.xfSize;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue