Move gran() to Modulator implementation file

This function is used only by the Modulator, and even then, only when testing.
This commit is contained in:
Allan Bazinet 2024-10-27 16:10:13 -07:00
parent 5d90376271
commit b60e019874
4 changed files with 12 additions and 22 deletions

View file

@ -2,6 +2,7 @@
#include <algorithm>
#include <cmath>
#include <limits>
#include <random>
#include <QDateTime>
#include <QDebug>
#include <QRandomGenerator>
@ -13,12 +14,20 @@
#include "moc_Modulator.cpp"
extern float gran(); // Noise generator (for tests only)
namespace
{
constexpr double TAU = 2 * M_PI;
// Noise generator, for tests only; generate gaussian random
// float with mean = 0 and std_dev = 1.
float
gran()
{
static std::normal_distribution<float> d;
return d(*QRandomGenerator::global());
}
unsigned
delayMS(qint32 const trPeriod)
{