Preserve's period detection: probes are placed by position, and a sustain loop is the span analysed
This commit is contained in:
@@ -329,9 +329,14 @@ SampleData buildSampleData(const ResolvedCapture& resolved, DecodedPcm decoded)
|
||||
data.play = resolvePlay(resolved.play, data.sampleRate);
|
||||
// The one place Preserve's source period is computed: the load, off the audio thread.
|
||||
// Channel 0 only — a stereo pair's two channels share a fundamental, and the splice
|
||||
// schedule is linked across them anyway.
|
||||
// schedule is linked across them anyway. The span is the sustain loop where one is long
|
||||
// enough (periodAnalysisSpan owns that rule) — every input to it commits through a full
|
||||
// reload, so the cache is re-derived whenever the span it was chosen from moves.
|
||||
const instrument::engine::AnalysisSpan span = instrument::engine::periodAnalysisSpan(
|
||||
data.frames.size(), data.loop.start, data.loop.end, data.loop.hasLoop, data.sampleRate);
|
||||
data.sourcePeriodFrames =
|
||||
instrument::engine::detectPeriod(data.frames, data.sampleRate).frames;
|
||||
instrument::engine::detectPeriod(data.frames, data.sampleRate, span.from, span.count)
|
||||
.frames;
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user