diff --git a/signalsmith-stretch.h b/signalsmith-stretch.h index 819ae2a..3991143 100644 --- a/signalsmith-stretch.h +++ b/signalsmith-stretch.h @@ -340,7 +340,7 @@ private: void processSpectrum(bool newSpectrum, Sample timeFactor) { timeFactor = std::max(timeFactor, 1/maxCleanStretch); bool randomTimeFactor = (timeFactor > maxCleanStretch); - std::uniform_real_distribution timeFactorDist(maxCleanStretch*2 - timeFactor, timeFactor); + std::uniform_real_distribution timeFactorDist(maxCleanStretch*2*randomTimeFactor - timeFactor, timeFactor); if (newSpectrum) { for (int c = 0; c < channels; ++c) {