Period detection: silence is not dissent but an absent period is — the agreement denominator is the probes that carried signal

This commit is contained in:
2026-08-02 04:19:59 -04:00
parent cc4967d21d
commit 91bd6f51a2
4 changed files with 195 additions and 58 deletions
+4 -2
View File
@@ -957,12 +957,14 @@ static void testBuildSampleDataDetectsOverTheSustainLoopNotTheWholeSource() {
CHECK(std::fabs(sd.sourcePeriodFrames - loopPeriod) < 2.0);
// A loop too short to host the full search band falls back to the whole source rather than
// to none — here that whole source has no one period, so the answer is the bare one above.
// to none — here that whole source has no one period, so the answer is none. Asserted
// against the literal, not against `bare`: the two agreeing would also hold if both
// regressed together, which is no evidence that the fallback ran.
InstrumentParams shortLoop;
shortLoop.loopOverride = SampleLoop{true, 118000, static_cast<std::int64_t>(frames)};
const SampleData shortSd = buildSampleData(resolveCapture(ref("b/a.wav", 60), shortLoop),
DecodedPcm{pcm, rate, {}});
CHECK(shortSd.sourcePeriodFrames == bare.sourcePeriodFrames);
CHECK(shortSd.sourcePeriodFrames == 0.0);
}
static void testBuildSampleDataCarriesTheVelocityCurve() {