Files
stk/src/Noise.cpp
Gary Scavone fc877b87bf Version 4.4.4
2013-09-29 23:22:28 +02:00

35 lines
672 B
C++

/***************************************************/
/*! \class Noise
\brief STK noise generator.
Generic random number generation using the
C rand() function. The quality of the rand()
function varies from one OS to another.
by Perry R. Cook and Gary P. Scavone, 1995-2012.
*/
/***************************************************/
#include "Noise.h"
#include <time.h>
namespace stk {
Noise :: Noise( unsigned int seed )
{
// Seed the random number generator
this->setSeed( seed );
}
void Noise :: setSeed( unsigned int seed )
{
if ( seed == 0 )
srand( (unsigned int) time( NULL ) );
else
srand( seed );
}
} // stk namespace