SynthLab SDK
SynthLab::NoiseGenerator Class Reference

Simple object that generates white, gaussian white or pink noise. More...

#include <synthbase.h>

Public Member Functions

double doGaussianWhiteNoise (double mean=0.0, double variance=1.0)
 Function generate gaussian white noise. More...
 
double doWhiteNoise ()
 Function generate white noise.
 
double doPinkNoise ()
 Function generate pink noise by filtering white noise.
 
double doPinkingFilter (double white)
 run the pinking filter More...
 

Public Attributes

std::default_random_engine defaultGeneratorEngine
 

Protected Attributes

double bN [3] = { 0.0, 0.0, 0.0 }
 
float g_fScale = 2.0f / 0xffffffff
 
int g_x1 = 0x67452301
 
int g_x2 = 0xefcdab89
 

Detailed Description

Simple object that generates white, gaussian white or pink noise.

Author
Will Pirkle http://www.willpirkle.com
Remarks
This object is included and described in further detail in Designing Software Synthesizer Plugins in C++ 2nd Ed. by Will Pirkle
Version
Revision : 1.0
Date
Date : 2021 / 04 / 26

Member Function Documentation

◆ doGaussianWhiteNoise()

double SynthLab::NoiseGenerator::doGaussianWhiteNoise ( double  mean = 0.0,
double  variance = 1.0 
)

Function generate gaussian white noise.

noise generation functions

Parameters
meanmean value of gaussian distribution
varianceof gaussian distribution

See also: https://github.com/divisionby-0/A.W.G.N./blob/master/AWGN.h

◆ doPinkingFilter()

double SynthLab::NoiseGenerator::doPinkingFilter ( double  white)

run the pinking filter

Parameters
whitethe white noise input sample
Returns
the pink-noise filtered signal

Member Data Documentation

◆ bN

double SynthLab::NoiseGenerator::bN[3] = { 0.0, 0.0, 0.0 }
protected

pinking filter coefficients

◆ defaultGeneratorEngine

std::default_random_engine SynthLab::NoiseGenerator::defaultGeneratorEngine

random number generator


The documentation for this class was generated from the following files: