private void Update() { modPhase += ModRate * ModulationUpdateRate; if (modPhase > 1) { modPhase -= 1; } var mod = FastSin.Get(modPhase); var totalDelay = SampleDelay + ModAmount * mod; var delayA = (int)totalDelay; var delayB = (int)totalDelay + 1; var partial = totalDelay - delayA; gainA = 1 - partial; gainB = partial; readIndexA = writeIndex - delayA; readIndexB = writeIndex - delayB; if (readIndexA < 0) { readIndexA += bufferSize; } if (readIndexB < 0) { readIndexB += bufferSize; } samplesProcessed = 0; }
private void Update() { modPhase += ModRate * ModulationUpdateRate; if (modPhase > 1) { modPhase -= 1; } var mod = FastSin.Get(modPhase); var totalDelay = SampleDelay + ModAmount * mod; delayA = (int)totalDelay; delayB = (int)totalDelay + 1; var partial = totalDelay - delayA; gainA = 1 - partial; gainB = partial; samplesProcessed = 0; }