Version 4.1.2

This commit is contained in:
Gary Scavone
2009-03-24 23:02:13 -04:00
committed by Stephen Sinclair
parent 6e0d1955a8
commit 586b0add5f
125 changed files with 7301 additions and 5337 deletions

View File

@@ -12,9 +12,19 @@
#include "Noise.h"
#include <stdlib.h>
#include <time.h>
Noise :: Noise() : Stk()
{
{
// Seed the random number generator with system time.
this->setSeed( 0 );
lastOutput = (MY_FLOAT) 0.0;
}
Noise :: Noise( unsigned int seed ) : Stk()
{
// Seed the random number generator
this->setSeed( seed );
lastOutput = (MY_FLOAT) 0.0;
}
@@ -22,6 +32,14 @@ Noise :: ~Noise()
{
}
void Noise :: setSeed( unsigned int seed )
{
if ( seed == 0 )
srand( (unsigned int) time(NULL) );
else
srand( seed );
}
MY_FLOAT Noise :: tick()
{
lastOutput = (MY_FLOAT) (2.0 * rand() / (RAND_MAX + 1.0) );