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:
2026-08-01 21:10:38 -04:00
parent 19aeb92775
commit 65f6070348
35 changed files with 772 additions and 226 deletions
+4 -2
View File
@@ -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