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:
@@ -9,7 +9,9 @@
|
||||
|
||||
#include "../src/core/instrument/note/musical_division.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <cstdio>
|
||||
#include <limits>
|
||||
|
||||
using namespace reasampler::instrument::note;
|
||||
|
||||
@@ -240,6 +242,11 @@ static void testShortestAtLeastDegenerateInputs() {
|
||||
const Division longest = makeDivision(kMaxQuarterExponent, DivisionModifier::Dotted);
|
||||
CHECK(almostEqual(divisionBeats(longest), kMaxDivisionBeats));
|
||||
CHECK(shortestDivisionAtLeast(kMaxDivisionBeats * 2.0) == longest);
|
||||
// A non-finite request names no length to be at least, so it takes the SAME never-short
|
||||
// answer as one nothing covers. Landing on the bottom rung instead would turn a corrupt
|
||||
// value into a near-instant note.
|
||||
CHECK(shortestDivisionAtLeast(std::nan("")) == longest);
|
||||
CHECK(shortestDivisionAtLeast(std::numeric_limits<double>::infinity()) == longest);
|
||||
}
|
||||
|
||||
int main() {
|
||||
|
||||
Reference in New Issue
Block a user