iso::synth::StochasticNoise Class Reference

stochastic noise generator More...

#include <iso_synth_noise_s.h>

Inherits iso::synth::InputUnit.

Inheritance diagram for iso::synth::StochasticNoise:

Inheritance graph
[legend]
Collaboration diagram for iso::synth::StochasticNoise:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 StochasticNoise (const math::Vector< sample > &pEnvelope)
 default constructor
 StochasticNoise (const String &pName, const math::Vector< sample > &pEnvelope)
 parameter based contructor
 StochasticNoise (unsigned int pChannelCount, const math::Vector< sample > &pEnvelope)
 parameter based contructor
 StochasticNoise (const String &pName, unsigned int pChannelCount, const math::Vector< sample > &pEnvelope)
 parameter based contructor
 StochasticNoise (const math::Vector< sample > &pEnvelope, unsigned int pFrameCount, unsigned int pChannelCount, unsigned int pRate) throw (SynthException)
 parameter based contructor
 StochasticNoise (const String &pName, const math::Vector< sample > &pEnvelope, unsigned int pFrameCount, unsigned int pChannelCount, unsigned int pRate) throw (SynthException)
 name and parameter based contructor
 StochasticNoise (const StochasticNoise &pUnit)
 copy constructor
 StochasticNoise (const String &pName, const StochasticNoise &pUnit)
 name & copy constructor
 StochasticNoise (const data::Values &pValues) throw (SynthException)
 values based constructor
 ~StochasticNoise ()
 destructor
void setEnvelope (math::Vector< sample > pEnvelope)
 set density function
virtual void process (Buffer *pBuffer) throw (SynthException)
 processes buffer
virtual String info (bool pPropagate=false, bool pShowPorts=true) const
 obtain textual unit information

Static Public Attributes

static const String sClassName
 default name

Protected Member Functions

 StochasticNoise ()
 default constructor
void scaleEnvelope ()
 scales the envelope Data between 0.0 and 1.0
sample stochasticSelect ()
 chooser algorithm that selects a value with a probability according to the density function.
Remarks:
algorithm courtesy of Martin Neukom

void init ()
 initializes wavetable and control ports

Protected Attributes

ControlPortmAmplitude
 amplitude control port
ControlPortmOffset
 amplitude control port
samplemDensityFunction
 internal expanded representation of the envelope vector
math::Vector< sample > * mEnvelope
 desired density function
math::Vector< sample > * mNewEnvelope
 new desired density function

Static Protected Attributes

static unsigned int sUnitCount
 total number of units created so far
static const unsigned int mDFResolution
 resolution of the internal density function

Friends

std::ostream & operator<< (std::ostream &pOstream, const StochasticNoise &pUnit)
 print unit information

Detailed Description

stochastic noise generator

generator

generates noise that fits a density profile.


ControlPorts
name: amplitude defaultValue: 1.0
name: offset defaultValue: 0.0

SwitchPorts:
name: active channelCount: 1 defaultValue: 1.0 resizable: false function: setActive

Created by John Flury on 12/07/07. Copyright 2006 John Flury All rights reserved.


Constructor & Destructor Documentation

StochasticNoise::StochasticNoise ( const math::Vector< sample > &  pEnvelope  ) 

default constructor

Parameters:
pEnvelope desired density function

StochasticNoise::StochasticNoise ( const String pName,
const math::Vector< sample > &  pEnvelope 
)

parameter based contructor

Parameters:
pName unit name
pEnvelope desired density function

StochasticNoise::StochasticNoise ( unsigned int  pChannelCount,
const math::Vector< sample > &  pEnvelope 
)

parameter based contructor

Parameters:
pChannelCount number of channels
pEnvelope desired density function

StochasticNoise::StochasticNoise ( const String pName,
unsigned int  pChannelCount,
const math::Vector< sample > &  pEnvelope 
)

parameter based contructor

Parameters:
pName unit name
pChannelCount number of channels
pEnvelope desired density function

StochasticNoise::StochasticNoise ( const math::Vector< sample > &  pEnvelope,
unsigned int  pFrameCount,
unsigned int  pChannelCount,
unsigned int  pRate 
) throw (SynthException)

parameter based contructor

Parameters:
pFrameCount number of frames
pChannelCount number of channels
pRate samping rate
pEnvelope desired density function

StochasticNoise::StochasticNoise ( const String pName,
const math::Vector< sample > &  pEnvelope,
unsigned int  pFrameCount,
unsigned int  pChannelCount,
unsigned int  pRate 
) throw (SynthException)

name and parameter based contructor

Parameters:
pName unit name
pFrameCount number of frames
pChannelCount number of channels
pRate samping rate
pEnvelope desired density function

StochasticNoise::StochasticNoise ( const StochasticNoise pUnit  ) 

copy constructor

Parameters:
pUnit unit to copy properties from
constructor copies frameCount, channelCount and rate but not unit name

StochasticNoise::StochasticNoise ( const String pName,
const StochasticNoise pUnit 
)

name & copy constructor

Parameters:
pName unit name
pUnit unit to copy properties from
constructor copies frameCount, channelCount and rate but not unit name

StochasticNoise::StochasticNoise ( const data::Values &  pValues  )  throw (SynthException)

values based constructor

Parameters:
pValues unit values
Exceptions:
SynthException failed to create unit
pValues structure & data types: 0: const String& : unit name 1: math::Vector<sample>& : desired density function 2: unsigned int : number of frames 3: unsigned int : number of channels 4: unsigned int : samping rate

StochasticNoise::~StochasticNoise (  ) 

destructor

StochasticNoise::StochasticNoise (  )  [protected]

default constructor


Member Function Documentation

void StochasticNoise::setEnvelope ( math::Vector< sample pEnvelope  ) 

set density function

Parameters:
pEnvelope ( density function values )
the supplied frame defines the new edge point of the density function by interpreting every pair of successing channels in the frame as a new point in the density function shape

void StochasticNoise::process ( Buffer pBuffer  )  throw (SynthException) [virtual]

processes buffer

Parameters:
pBuffer buffer to process

Reimplemented from iso::synth::InputUnit.

String StochasticNoise::info ( bool  pPropagate = false,
bool  pShowPorts = true 
) const [virtual]

obtain textual unit information

Parameters:
pPropagate if true, the unit calls the info methods of its input ports
pShowPorts print port information
Returns:
String containing unit information

Reimplemented from iso::synth::InputUnit.

void StochasticNoise::scaleEnvelope (  )  [protected]

scales the envelope Data between 0.0 and 1.0

for convenience at the process() method

sample StochasticNoise::stochasticSelect (  )  [protected]

chooser algorithm that selects a value with a probability according to the density function.

Remarks:
algorithm courtesy of Martin Neukom

void StochasticNoise::init (  )  [protected]

initializes wavetable and control ports


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  pOstream,
const StochasticNoise pUnit 
) [friend]

print unit information


Member Data Documentation

const String StochasticNoise::sClassName [static]

default name

Reimplemented from iso::synth::InputUnit.

unsigned int StochasticNoise::sUnitCount [static, protected]

total number of units created so far

Reimplemented from iso::synth::InputUnit.

ControlPort* iso::synth::StochasticNoise::mAmplitude [protected]

amplitude control port

ControlPort* iso::synth::StochasticNoise::mOffset [protected]

amplitude control port

sample* iso::synth::StochasticNoise::mDensityFunction [protected]

internal expanded representation of the envelope vector

const unsigned int StochasticNoise::mDFResolution [static, protected]

resolution of the internal density function

math::Vector<sample>* iso::synth::StochasticNoise::mEnvelope [protected]

desired density function

math::Vector<sample>* iso::synth::StochasticNoise::mNewEnvelope [protected]

new desired density function

whenever a new array of evelope values is supplied, it is temporarily stored as mNewAmplitudeResponse until the beginning of the next process call


The documentation for this class was generated from the following files:
Generated on Fri Feb 25 14:18:45 2011 for synth by  doxygen 1.5.1