From e0231d5267fa7b80d6c741b128ad125f8731e108 Mon Sep 17 00:00:00 2001 From: Geraint Date: Wed, 10 May 2023 18:40:50 +0100 Subject: [PATCH] Fix inverted arguments for real distribution --- signalsmith-stretch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) {