From e9f38c78a5c26f744b19db193abd731a90aeaac6 Mon Sep 17 00:00:00 2001 From: xenakios Date: Thu, 8 Nov 2018 18:54:44 +0200 Subject: [PATCH] Use Juce Logger for FFT size warning. Just use an increasing static int to init the FFT random generator. should be good enough. --- Source/PS_Source/Stretch.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Source/PS_Source/Stretch.cpp b/Source/PS_Source/Stretch.cpp index f41c854..be1aacf 100644 --- a/Source/PS_Source/Stretch.cpp +++ b/Source/PS_Source/Stretch.cpp @@ -25,7 +25,7 @@ FFT::FFT(int nsamples_, bool no_inverse) nsamples=nsamples_; if (nsamples%2!=0) { nsamples+=1; - printf("WARNING: Odd sample size on FFT::FFT() (%d)",nsamples); + Logger::writeToLog("WARNING: Odd sample size on FFT::FFT() "+String(nsamples)); }; smp.resize(nsamples); for (int i = 0; i < nsamples; i++) @@ -58,12 +58,9 @@ FFT::FFT(int nsamples_, bool no_inverse) } //double t1 = Time::getMillisecondCounterHiRes(); //Logger::writeToLog("Creating FFTW3 plans took "+String(t1-t0)+ "ms"); - - //timeCall("Initing FFT random generator", [this]() - //{ - std::random_device rand_device; - m_randgen = std::mt19937(rand_device()); - //}); + static int seed = 0; + m_randgen = std::mt19937(seed); + ++seed; }; FFT::~FFT()