#include <Noise.h>

Public Member Functions | |
| PinkNoise () | |
| Constructors. | |
| PinkNoise (double ampl, double offset=0.f) | |
| PinkNoise (int seed, double ampl=1.f, double offset=0.f) | |
| ~PinkNoise () | |
| void | nextBuffer (Buffer &outputBuffer, unsigned outBufNum) throw (CException) |
| Destructor. | |
| sample | nextPink () |
| returns the next pink noise sample | |
Protected Member Functions | |
| void | initialize (int numRows) |
| set up PinkNoise for N rows of generators | |
Protected Attributes | |
| int | mPinkRows [PINK_MAX_RANDOM_ROWS] |
| Pink noise generator rows. | |
| int | mPinkRunningSum |
| Used to optimize summing of generators. | |
| int | mPinkIndex |
| Incremented each sample. | |
| int | mPinkIndexMask |
| Index wrapped by ANDing with this mask. | |
| float | mPinkScalar |
| Used to scale within range of -1.0 to +1.0. | |
| PinkNoise::PinkNoise | ( | ) |
Constructors.
Most of this code was taken from an public domain C implementation written by Phil Burk. The code and the webpage explaining it is at http://www.firstpr.com.au/dsp/pink-noise/phil_burk_19990905mPatestmPink.c and http://www.firstpr.com.au/dsp/pink-noise/
References initialize(), csl::kExpand, and csl::UnitGenerator::setCopyPolicy().
| PinkNoise::PinkNoise | ( | double | ampl, | |
| double | offset = 0.f | |||
| ) |
References initialize(), csl::kExpand, and csl::UnitGenerator::setCopyPolicy().
| PinkNoise::PinkNoise | ( | int | seed, | |
| double | ampl = 1.f, |
|||
| double | offset = 0.f | |||
| ) |
References initialize(), csl::kExpand, and csl::UnitGenerator::setCopyPolicy().
| csl::PinkNoise::~PinkNoise | ( | ) | [inline] |
| void PinkNoise::nextBuffer | ( | Buffer & | outputBuffer, | |
| unsigned | outBufNum | |||
| ) | throw (CException) [virtual] |
Destructor.
the monoNextBuffer method is where the DSP takes place
Reimplemented from csl::UnitGenerator.
References DECLARE_SCALABLE_CONTROLS, LOAD_SCALABLE_CONTROLS, csl::logMsg(), and UPDATE_SCALABLE_CONTROLS.
| sample PinkNoise::nextPink | ( | ) |
returns the next pink noise sample
References csl::Noise::generateRandomNumber(), mPinkIndex, mPinkIndexMask, mPinkRows, mPinkRunningSum, mPinkScalar, and PINK_RANDOM_SHIFT.
| void PinkNoise::initialize | ( | int | numRows | ) | [protected] |
set up PinkNoise for N rows of generators
Setup PinkNoise structure for N rows of generators.
References mPinkIndex, mPinkIndexMask, mPinkRows, mPinkRunningSum, mPinkScalar, and PINK_RANDOM_BITS.
Referenced by PinkNoise().
int csl::PinkNoise::mPinkRows[PINK_MAX_RANDOM_ROWS] [protected] |
int csl::PinkNoise::mPinkRunningSum [protected] |
int csl::PinkNoise::mPinkIndex [protected] |
int csl::PinkNoise::mPinkIndexMask [protected] |
float csl::PinkNoise::mPinkScalar [protected] |
1.5.8