Use Juce Logger for FFT size warning. Just use an increasing static int to init the FFT random generator. should be good enough.

This commit is contained in:
xenakios 2018-11-08 18:54:44 +02:00
parent 0eadb853f7
commit e9f38c78a5

View File

@ -25,7 +25,7 @@ FFT::FFT(int nsamples_, bool no_inverse)
nsamples=nsamples_; nsamples=nsamples_;
if (nsamples%2!=0) { if (nsamples%2!=0) {
nsamples+=1; 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); smp.resize(nsamples);
for (int i = 0; i < nsamples; i++) for (int i = 0; i < nsamples; i++)
@ -58,12 +58,9 @@ FFT::FFT(int nsamples_, bool no_inverse)
} }
//double t1 = Time::getMillisecondCounterHiRes(); //double t1 = Time::getMillisecondCounterHiRes();
//Logger::writeToLog("Creating FFTW3 plans took "+String(t1-t0)+ "ms"); //Logger::writeToLog("Creating FFTW3 plans took "+String(t1-t0)+ "ms");
static int seed = 0;
//timeCall("Initing FFT random generator", [this]() m_randgen = std::mt19937(seed);
//{ ++seed;
std::random_device rand_device;
m_randgen = std::mt19937(rand_device());
//});
}; };
FFT::~FFT() FFT::~FFT()