6 #ifndef INCLUDE_Noise_H
7 #define INCLUDE_Noise_H
11 #define PINK_MAX_RANDOM_ROWS (30)
12 #define PINK_RANDOM_BITS (24)
13 #define PINK_RANDOM_SHIFT ((sizeof(long)*8)-PINK_RANDOM_BITS)
32 Noise(
double ampl,
double offset = 0.0);
33 Noise(
int seed,
double ampl = 1.0,
double offset = 0.0);
50 WhiteNoise(
int seed,
double ampl = 1.0,
double offset = 0.0) :
Noise(seed, ampl, offset) { };
70 PinkNoise(
double ampl,
double offset = 0.f);
71 PinkNoise(
int seed,
double ampl = 1.f,
double offset = 0.f);
102 return (
float)
mSeed / (float) 0x7fffffff;
sample nextPink()
returns the next pink noise sample
float generateNormalizedRandomNumber()
returns next pseudo-random normalised to +/- 1.0
int mPinkIndex
Incremented each sample.
AdditiveInstrument.h – Sum-of-sines synthesis instrument class.
int generateRandomNumber()
returns the next pseudo-random number
void initialize(int numRows)
set up PinkNoise for N rows of generators
Abstract Noise class - inherits from UnitGenerator & Scalable, and provides constructors and basic ps...
WhiteNoise(double ampl, double offset=0.0)
float mDivisor
factor to scale ints to +/- 1.0
#define PINK_MAX_RANDOM_ROWS
Noise.h – Noise Unit Generators Comprising Noise superclass, and WhiteNoise, PinkNoise subclasses...
White noise – equal power per frequency.
WhiteNoise()
Constructors.
int mPinkRunningSum
Used to optimize summing of generators.
Scalable – mix-in class with scale and offset control inputs (may be constants or generators)...
int mPinkIndexMask
Index wrapped by ANDing with this mask.
int mPinkRows[PINK_MAX_RANDOM_ROWS]
Pink noise generator rows.
float mPinkScalar
Used to scale within range of -1.0 to +1.0.
float sample
(could be changed to int, or double)
WhiteNoise(int seed, double ampl=1.0, double offset=0.0)
Buffer – the multi-channel sample buffer class (passed around between generators and IO guys)...
void setSeed(int seed)
set the seed integer for the pseudo-random number generators
void dump()
Tell me more about what is happening.
void nextBuffer(Buffer &outputBuffer, unsigned outBufNum)
Destructor.
void nextBuffer(Buffer &outputBuffer, unsigned outBufNum)
Destructor.
Pink noise – equal power per octave.
Base class of CSL exceptions (written upper-case). Has a string message.