Version 4.2.0

This commit is contained in:
Gary Scavone
2009-03-24 23:02:14 -04:00
committed by Stephen Sinclair
parent cf06b7598b
commit a6381b9d38
281 changed files with 17152 additions and 12000 deletions

View File

@@ -6,7 +6,7 @@
C rand() function. The quality of the rand()
function varies from one OS to another.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
by Perry R. Cook and Gary P. Scavone, 1995 - 2004.
*/
/***************************************************/
@@ -14,18 +14,18 @@
#include <stdlib.h>
#include <time.h>
Noise :: Noise() : Stk()
Noise :: Noise() : Generator()
{
// Seed the random number generator with system time.
this->setSeed( 0 );
lastOutput = (MY_FLOAT) 0.0;
lastOutput_ = (StkFloat) 0.0;
}
Noise :: Noise( unsigned int seed ) : Stk()
Noise :: Noise( unsigned int seed ) : Generator()
{
// Seed the random number generator
this->setSeed( seed );
lastOutput = (MY_FLOAT) 0.0;
lastOutput_ = (StkFloat) 0.0;
}
Noise :: ~Noise()
@@ -40,23 +40,20 @@ void Noise :: setSeed( unsigned int seed )
srand( seed );
}
MY_FLOAT Noise :: tick()
StkFloat Noise :: tick()
{
lastOutput = (MY_FLOAT) (2.0 * rand() / (RAND_MAX + 1.0) );
lastOutput -= 1.0;
return lastOutput;
lastOutput_ = (StkFloat) (2.0 * rand() / (RAND_MAX + 1.0) );
lastOutput_ -= 1.0;
return lastOutput_;
}
MY_FLOAT *Noise :: tick(MY_FLOAT *vector, unsigned int vectorSize)
StkFloat *Noise :: tick(StkFloat *vector, unsigned int vectorSize)
{
for (unsigned int i=0; i<vectorSize; i++)
vector[i] = tick();
return vector;
return Generator::tick( vector, vectorSize );
}
MY_FLOAT Noise :: lastOut() const
StkFrames& Noise :: tick( StkFrames& frames, unsigned int channel )
{
return lastOutput;
return Generator::tick( frames, channel );
}