#include <iso_synth_noise_s.h>
Inherits iso::synth::InputUnit.
Inheritance diagram for iso::synth::StochasticNoise:
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.
| |
void | init () |
initializes wavetable and control ports | |
Protected Attributes | |
ControlPort * | mAmplitude |
amplitude control port | |
ControlPort * | mOffset |
amplitude control port | |
sample * | mDensityFunction |
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 |
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.
StochasticNoise::StochasticNoise | ( | const math::Vector< sample > & | pEnvelope | ) |
default constructor
pEnvelope | desired density function |
parameter based contructor
pName | unit name | |
pEnvelope | desired density function |
StochasticNoise::StochasticNoise | ( | unsigned int | pChannelCount, | |
const math::Vector< sample > & | pEnvelope | |||
) |
parameter based contructor
pChannelCount | number of channels | |
pEnvelope | desired density function |
StochasticNoise::StochasticNoise | ( | const String & | pName, | |
unsigned int | pChannelCount, | |||
const math::Vector< sample > & | pEnvelope | |||
) |
parameter based contructor
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
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
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
pUnit | unit to copy properties from |
StochasticNoise::StochasticNoise | ( | const String & | pName, | |
const StochasticNoise & | pUnit | |||
) |
name & copy constructor
pName | unit name | |
pUnit | unit to copy properties from |
StochasticNoise::StochasticNoise | ( | const data::Values & | pValues | ) | throw (SynthException) |
values based constructor
pValues | unit values |
SynthException | failed to create unit |
StochasticNoise::~StochasticNoise | ( | ) |
destructor
StochasticNoise::StochasticNoise | ( | ) | [protected] |
default constructor
void StochasticNoise::setEnvelope | ( | math::Vector< sample > | pEnvelope | ) |
set density function
pEnvelope | ( density function values ) |
void StochasticNoise::process | ( | Buffer * | pBuffer | ) | throw (SynthException) [virtual] |
String StochasticNoise::info | ( | bool | pPropagate = false , |
|
bool | pShowPorts = true | |||
) | const [virtual] |
obtain textual unit information
pPropagate | if true, the unit calls the info methods of its input ports | |
pShowPorts | print port 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.
void StochasticNoise::init | ( | ) | [protected] |
initializes wavetable and control ports
std::ostream& operator<< | ( | std::ostream & | pOstream, | |
const StochasticNoise & | pUnit | |||
) | [friend] |
print unit information
const String StochasticNoise::sClassName [static] |
unsigned int StochasticNoise::sUnitCount [static, protected] |
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