Remove granulator latency: window+pan the live input (no delay buffer)
The granulators read grains from behind the write head, so each grain replayed the last grainSize of audio — an audible delay. Rework StereoGranulator to the straight-through approach (matching Lyrebird's InputGrain at position 0): grains apply their Hann window and random pan to the LIVE input sample with no look-back buffer, so there is zero added latency. Output is normalised by overlap so density doesn't change level. Drops the circular buffer entirely. GranulatorPedal / AutoGranulatorPedal are unchanged (same generator API). Generator tests (seeded determinism, zero-spread centering, full-spread L/R separation) still hold. Suite 271. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -52,9 +52,6 @@ struct AutoGranulatorPedalTests {
|
||||
}
|
||||
}
|
||||
|
||||
// Small min/max grains so audible output (which trails the write head by one grain) fills the
|
||||
// reader's 4096-frame window.
|
||||
|
||||
@Test func buildsAndProducesNonSilentOutput() throws {
|
||||
let samples: [Float] = try render { pedal in pedal.minGrain = 0.01; pedal.maxGrain = 0.03 }
|
||||
#expect(!samples.isEmpty)
|
||||
|
||||
Reference in New Issue
Block a user