Bake window: derived note lengths carry exact durations, not ladder rungs — a long take is no longer cut at 384 beats
Hold keeps its picker. Also: one home for the %-fold, duration-ordered Hold travel, and a corrupt tail degrades to absent rather than fabricating one.
This commit is contained in:
@@ -10,8 +10,10 @@ std::int64_t triggerPlayLength(double lengthFraction,
|
||||
std::int64_t frameCount,
|
||||
std::int64_t startFrame) {
|
||||
const std::int64_t postStart = (std::max)(std::int64_t{0}, frameCount - startFrame);
|
||||
if (postStart <= 0 || lengthFraction <= 0.0) return 0;
|
||||
return static_cast<std::int64_t>(lengthFraction * static_cast<double>(postStart) + 0.5);
|
||||
if (postStart <= 0 || !(lengthFraction > 0.0)) return 0; // also catches NaN
|
||||
const double frac = (std::min)(1.0, lengthFraction);
|
||||
const auto len = static_cast<std::int64_t>(frac * static_cast<double>(postStart) + 0.5);
|
||||
return (std::min)(postStart, (std::max)(std::int64_t{0}, len));
|
||||
}
|
||||
|
||||
} // namespace reasampler::instrument::map
|
||||
|
||||
Reference in New Issue
Block a user