Jamoma API  0.6.0.a19
TTNoise Class Reference

Noise Generator. More...

#include <TTNoise.h>

+ Inheritance diagram for TTNoise:
+ Collaboration diagram for TTNoise:

Protected Member Functions

TTErr processWhiteNoise (TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
 Audio processing method generating white noise. More...
 
TTErr processGauss (TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
 Audio processing method using the mersenne twister algorithm for gaussian distribution noise. More...
 
TTErr processPinkNoise (TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
 Audio processing method generating pink noise. More...
 
TTErr processBrownNoise (TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
 Audio processing method generating brown noise. More...
 
TTErr processBlueNoise (TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
 Audio processing method generating blue noise. More...
 
TTErr setMode (const TTValue &newMode)
 Set the mode, that is: Set what kind of noise to generate. More...
 
TTErr setGain (const TTValue &newValue)
 Set the overall gain of the generated noise signal. More...
 
TTErr setNumChannels (const TTChannelCount newNumChannels)
 Set the number of channels to process. More...
 
TTErr getGain (TTValue &returnedValue)
 Get the current value used for scaling overall gain level of the generated noise signal. More...
 
TTErr Clear ()
 Clear past values used internally by various noise generator algorithms. More...
 

Protected Attributes

MTRand mTwister
 Class implementing Mersenne Twister algorithm.
 
TTFloat64 mMean
 Mean value for gauss distribution process method.
 
TTFloat64 mStd
 Standard deviation value for gauss distribution process method.
 
TTSymbol mMode
 Attribute: what color is the noise?
 
TTFloat64 mGain
 Gain stage.
 
TTChannelCount mNumChannels
 Sets the number of noise channels.
 
TTUInt32 accum
 Accumulator for the noise generation.
 
TTSampleVector mb0
 Internal coefficient used to keep track of past values. Used for some noise algorithms.
 
TTSampleVector mb1
 Internal coefficient used to keep track of past values. Used for some noise algorithms.
 
TTSampleVector mb2
 Internal coefficient used to keep track of past values. Used for some noise algorithms.
 
TTSampleVector mb3
 Internal coefficient used to keep track of past values. Used for some noise algorithms.
 
TTSampleVector mb4
 Internal coefficient used to keep track of past values. Used for some noise algorithms.
 
TTSampleVector mb5
 Internal coefficient used to keep track of past values. Used for some noise algorithms.
 
TTSampleVector mb6
 Internal coefficient used to keep track of past values. Used for some noise algorithms.
 

Detailed Description

Noise Generator.

Definition at line 32 of file TTNoise.h.

Member Function Documentation

TTErr TTNoise::Clear ( )
protected

Clear past values used internally by various noise generator algorithms.

Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 66 of file TTNoise.cpp.

References kTTErrNone, mb0, mb1, mb2, mb3, mb4, mb5, mb6, and mNumChannels.

Referenced by setNumChannels().

TTErr TTNoise::getGain ( TTValue returnedValue)
protected

Get the current value used for scaling overall gain level of the generated noise signal.

Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 102 of file TTNoise.cpp.

References kTTErrNone, mGain, and TTLinearGainToDecibels().

+ Here is the call graph for this function:

TTErr TTNoise::processBlueNoise ( TTAudioSignalArrayPtr  inputs,
TTAudioSignalArrayPtr  outputs 
)
protected

Audio processing method generating blue noise.

Parameters
inputsThe input signal to process.
outputsThe processed audio signal.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 217 of file TTNoise.cpp.

References accum, kTTErrNone, mb0, mGain, mNumChannels, TTAudioSignal::mSampleVectors, mTwister, and setNumChannels().

Referenced by setMode().

+ Here is the call graph for this function:

TTErr TTNoise::processBrownNoise ( TTAudioSignalArrayPtr  inputs,
TTAudioSignalArrayPtr  outputs 
)
protected

Audio processing method generating brown noise.

Parameters
inputsThe input signal to process.
outputsThe processed audio signal.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 179 of file TTNoise.cpp.

References accum, kTTErrNone, mb0, mGain, mNumChannels, TTAudioSignal::mSampleVectors, mTwister, and setNumChannels().

Referenced by setMode().

+ Here is the call graph for this function:

TTErr TTNoise::processGauss ( TTAudioSignalArrayPtr  inputs,
TTAudioSignalArrayPtr  outputs 
)
protected

Audio processing method using the mersenne twister algorithm for gaussian distribution noise.

Parameters
inputsThe input signal to process.
outputsThe processed audio signal.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Referenced by setMode().

TTErr TTNoise::processPinkNoise ( TTAudioSignalArrayPtr  inputs,
TTAudioSignalArrayPtr  outputs 
)
protected

Audio processing method generating pink noise.

Parameters
inputsThe input signal to process.
outputsThe processed audio signal.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 138 of file TTNoise.cpp.

References accum, kTTErrNone, mb0, mb1, mb2, mb3, mb4, mb5, mb6, mGain, mNumChannels, TTAudioSignal::mSampleVectors, mTwister, and setNumChannels().

Referenced by setMode().

+ Here is the call graph for this function:

TTErr TTNoise::processWhiteNoise ( TTAudioSignalArrayPtr  inputs,
TTAudioSignalArrayPtr  outputs 
)
protected

Audio processing method generating white noise.

Parameters
inputsThe input signal to process.
outputsThe processed audio signal.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 109 of file TTNoise.cpp.

References accum, kTTErrNone, mGain, mNumChannels, TTAudioSignal::mSampleVectors, mTwister, and setNumChannels().

Referenced by setMode().

+ Here is the call graph for this function:

TTErr TTNoise::setGain ( const TTValue newValue)
protected

Set the overall gain of the generated noise signal.

@param newValue The new value that we want to apply for gain scaling.

Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 95 of file TTNoise.cpp.

References kTTErrNone, mGain, and TTDecibelsToLinearGain().

+ Here is the call graph for this function:

TTErr TTNoise::setMode ( const TTValue newMode)
protected

Set the mode, that is: Set what kind of noise to generate.

Parameters
newModeThe noise mode that we want to use.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 79 of file TTNoise.cpp.

References mMode, processBlueNoise(), processBrownNoise(), processGauss(), processPinkNoise(), processWhiteNoise(), setProcessMethod, and TT.

+ Here is the call graph for this function:

TTErr TTNoise::setNumChannels ( const TTChannelCount  newNumChannels)
protected

Set the number of channels to process.

Parameters
newNumChannelsThe number of channels to process.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 51 of file TTNoise.cpp.

References Clear(), kTTErrNone, mb0, mb1, mb2, mb3, mb4, mb5, mb6, and mNumChannels.

Referenced by processBlueNoise(), processBrownNoise(), processPinkNoise(), and processWhiteNoise().

+ Here is the call graph for this function:


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