iso::synth::FunctionGenerator Class Reference

creates buffers containing sampled values of particular function ranges More...

#include <iso_synth_function_generator.h>

Collaboration diagram for iso::synth::FunctionGenerator:

Collaboration graph
[legend]
List of all members.

Public Member Functions

ChannelcreateFunctionBuffer (const FunctionDescriptor &pFunctionDescriptor) throw (SynthException)
 create functon buffer
ChannelcreateFunctionBuffer (FunctionType pFunctionType, sample pControlParameter, const math::Vector2< sample > &pXRange, const math::Vector2< sample > &pYLimits, int pFrameCount) throw (SynthException)
 create a function buffer
ChannelcreateFunctionBuffer (FunctionType pFunctionType, const math::Vector2< sample > &pXRange, const math::Vector2< sample > &pYLimits, int pFrameCount) throw (SynthException)
 create a function buffer
ChannelcreateFunctionBuffer (FunctionType pFunctionType, math::Vector< sample > &pControlPoints, int pFrameCount) throw (SynthException)
 create a function buffer
ChannelcreateFunctionBuffer (FunctionType pFunctionType, math::Vector< sample > &pControlPoints, sample pControlParameter, int pFrameCount) throw (SynthException)
 create a function buffer
ChannelcreateFunctionBuffer (FunctionType pFunctionType, math::Vector< sample > &pControlPoints, math::Vector< sample > &pControlParameters, int pFrameCount) throw (SynthException)
 create a function buffer

Static Public Member Functions

static FunctionGeneratorget ()
static void destroy ()

Protected Member Functions

 FunctionGenerator ()
 default constructor
 ~FunctionGenerator ()
 destructor
ChannelcreateRectBuffer (const math::Vector2< sample > &pXRange, const math::Vector2< sample > &pYLimits, unsigned int pFrameCount)
 create rect function
ChannelcreateLinearBuffer (const math::Vector2< sample > &pXRange, const math::Vector2< sample > &pYLimits, unsigned int pFrameCount)
 create linear function
ChannelcreateSineBuffer (const math::Vector2< sample > &pXRange, const math::Vector2< sample > &pYLimits, unsigned int pFrameCount)
 create sine function
ChannelcreateExpBuffer (sample pControlParameter, bool pMirrorX, const math::Vector2< sample > &pYLimits, unsigned int pFrameCount)
 create exp function
ChannelcreateLogBuffer (sample pControlParameter, bool pMirrorX, const math::Vector2< sample > &pYLimits, unsigned int pFrameCount)
 create log function
ChannelcreateSigmoidBuffer (sample pControlParameter, const math::Vector2< sample > &pXRange, const math::Vector2< sample > &pYLimits, unsigned int pFrameCount)
 create sigmoid function
ChannelcreateSigExpBuffer (sample pControlParameter, const math::Vector2< sample > &pXRange, const math::Vector2< sample > &pYLimits, unsigned int pFrameCount)
 create sigmoid based pseudo exponential function
ChannelcreateSigLogBuffer (sample pControlParameter, const math::Vector2< sample > &pXRange, const math::Vector2< sample > &pYLimits, unsigned int pFrameCount)
 create sigmoid based pseudo logarithm function
ChannelcreateGaussianBuffer (sample pControlParameter, const math::Vector2< sample > &pXRange, const math::Vector2< sample > &pYLimits, unsigned int pFrameCount)
 create graussian function
ChannelcreateHammingBuffer (const math::Vector2< sample > &pXRange, const math::Vector2< sample > &pYLimits, unsigned int pFrameCount)
 create hamming function
ChannelcreateHannBuffer (const math::Vector2< sample > &pXRange, const math::Vector2< sample > &pYLimits, unsigned int pFrameCount)
 create han function
void rescaleYRange (Channel *pChannel, const math::Vector2< sample > &pYLimits)
 rescales sample values to lie within y min and max limits

Protected Attributes

unsigned int mStandardFrameCount
 default frame count for generated buffers

Static Protected Attributes

static FunctionGeneratorsFunctionGenerator
 singleton instance member variable
static sample sMaxY
 max y value for rescaling
static sample sMinY
 min y value for rescaling

Detailed Description

creates buffers containing sampled values of particular function ranges

containing sampled values of particular function ranges

Created by Daniel Bisig on 7/3/06. Copyright 2006 Daniel Bisig All rights reserved.


Constructor & Destructor Documentation

FunctionGenerator::FunctionGenerator (  )  [protected]

default constructor

FunctionGenerator::~FunctionGenerator (  )  [protected]

destructor


Member Function Documentation

FunctionGenerator & FunctionGenerator::get (  )  [static]

void FunctionGenerator::destroy (  )  [static]

Channel * FunctionGenerator::createFunctionBuffer ( const FunctionDescriptor pFunctionDescriptor  )  throw (SynthException)

create functon buffer

Parameters:
pFunctionDescriptor function descriptor
Exceptions:
SynthException failed to create function buffer

Channel * FunctionGenerator::createFunctionBuffer ( FunctionType  pFunctionType,
sample  pControlParameter,
const math::Vector2< sample > &  pXRange,
const math::Vector2< sample > &  pYLimits,
int  pFrameCount 
) throw (SynthException)

create a function buffer

Parameters:
pFunctionType function type
pControlParameter control parameter (required for certain functions)
pXRange x range
pYLimits y min and max values (if y min == y max: don't rescale)
pFrameCount frame count of buffer, if < 0, standard frame count is employed
Returns:
channel
Exceptions:
SynthException failed to create function buffer

Channel * FunctionGenerator::createFunctionBuffer ( FunctionType  pFunctionType,
const math::Vector2< sample > &  pXRange,
const math::Vector2< sample > &  pYLimits,
int  pFrameCount 
) throw (SynthException)

create a function buffer

Parameters:
pFunctionType function type
pXRange x range
pYLimits y min and max values (if y min == y max: don't rescale)
pFrameCount frame count of buffer, if < 0, standard frame count is employed
Returns:
channel
Exceptions:
SynthException failed to create function buffer

Channel * FunctionGenerator::createFunctionBuffer ( FunctionType  pFunctionType,
math::Vector< sample > &  pControlPoints,
int  pFrameCount 
) throw (SynthException)

create a function buffer

Parameters:
pFunctionType function type
pControlPoints control points for creating series of function segments
pFrameCount frame count of buffer, if < 0, standard frame count is employed
Returns:
channel
Exceptions:
SynthException failed to create function buffer
creates a buffer from a series of control points by interpolating in between the control points via the supplied function type
this methods is mainly intended for the following function types: RECT, LINEAR, SIGMOID, BEZIER, HERMITE

Channel * FunctionGenerator::createFunctionBuffer ( FunctionType  pFunctionType,
math::Vector< sample > &  pControlPoints,
sample  pControlParameter,
int  pFrameCount 
) throw (SynthException)

create a function buffer

Parameters:
pFunctionType function type
pControlPoints control points for creating series of function segments
pControlParameter control parameter for all function segments
pFrameCount frame count of buffer, if < 0, standard frame count is employed
Returns:
channel
Exceptions:
SynthException failed to create function buffer
creates a buffer from a series of control points by interpolating in between the control points via the supplied function type
this methods is mainly intended for the following function types: LINEAR, BEZIER, HERMITE

Channel * FunctionGenerator::createFunctionBuffer ( FunctionType  pFunctionType,
math::Vector< sample > &  pControlPoints,
math::Vector< sample > &  pControlParameters,
int  pFrameCount 
) throw (SynthException)

create a function buffer

Parameters:
pFunctionType function type
pControlPoints control points for creating series of function segments
pControlParameters control parameters for creating series of function segments
pFrameCount frame count of buffer, if < 0, standard frame count is employed
Returns:
channel
Exceptions:
SynthException failed to create function buffer
creates a buffer from a series of control points by interpolating in between the control points via the supplied function type
this methods is mainly intended for the following function types: LINEAR, BEZIER, HERMITE

Channel * FunctionGenerator::createRectBuffer ( const math::Vector2< sample > &  pXRange,
const math::Vector2< sample > &  pYLimits,
unsigned int  pFrameCount 
) [protected]

create rect function

Parameters:
pXRange x range
pYLimits y min and max values
pFrameCount frame count
Returns:
channel

Channel * FunctionGenerator::createLinearBuffer ( const math::Vector2< sample > &  pXRange,
const math::Vector2< sample > &  pYLimits,
unsigned int  pFrameCount 
) [protected]

create linear function

Parameters:
pXRange x range
pYLimits y min and max values
pFrameCount frame count
Returns:
channel

Channel * FunctionGenerator::createSineBuffer ( const math::Vector2< sample > &  pXRange,
const math::Vector2< sample > &  pYLimits,
unsigned int  pFrameCount 
) [protected]

create sine function

Parameters:
pXRange x range
pYLimits y min and max values
pFrameCount frame count
Returns:
channel

Channel * FunctionGenerator::createExpBuffer ( sample  pControlParameter,
bool  pMirrorX,
const math::Vector2< sample > &  pYLimits,
unsigned int  pFrameCount 
) [protected]

create exp function

Parameters:
pControlParameter control parameter ( 0.75 (linear) - 10 (in between) - 1000 (extreme exp) )
pMirrorX horizonal function mirroring
pYLimits y min and max values
pFrameCount frame count
Returns:
channel

Channel * FunctionGenerator::createLogBuffer ( sample  pControlParameter,
bool  pMirrorX,
const math::Vector2< sample > &  pYLimits,
unsigned int  pFrameCount 
) [protected]

create log function

Parameters:
pControlParameter control parameter ( 0.49 (linear) - 0.001 (in between) - 0.000000001 (extreme log) )
pMirrorX horizonal function mirroring
pYLimits y min and max values
pFrameCount frame count
Returns:
channel

Channel * FunctionGenerator::createSigmoidBuffer ( sample  pControlParameter,
const math::Vector2< sample > &  pXRange,
const math::Vector2< sample > &  pYLimits,
unsigned int  pFrameCount 
) [protected]

create sigmoid function

Parameters:
pControlParameter control parameter ( 0.99 (linear) - 0.1 (in between) - 0.000000001 (extreme sigmoid (essentially threshold) ) )
pXRange x range
pYLimits y min and max values
pFrameCount frame count
Returns:
channel

Channel * FunctionGenerator::createSigExpBuffer ( sample  pControlParameter,
const math::Vector2< sample > &  pXRange,
const math::Vector2< sample > &  pYLimits,
unsigned int  pFrameCount 
) [protected]

create sigmoid based pseudo exponential function

Parameters:
pControlParameter control parameter ( 0.99 (linear) - 0.1 (in between) - 0.000000001 (extreme sigmoid (essentially threshold) ) )
pXRange x range
pYLimits y min and max values
pFrameCount frame count
Returns:
channel
this function is simply a convenience function that is based on the first half of the sigmoid function

Channel * FunctionGenerator::createSigLogBuffer ( sample  pControlParameter,
const math::Vector2< sample > &  pXRange,
const math::Vector2< sample > &  pYLimits,
unsigned int  pFrameCount 
) [protected]

create sigmoid based pseudo logarithm function

Parameters:
pControlParameter control parameter ( 0.99 (linear) - 0.1 (in between) - 0.000000001 (extreme sigmoid (essentially threshold) ) )
pXRange x range
pYLimits y min and max values
pFrameCount frame count
Returns:
channel
this function is simply a convenience function that is based on the first half of the sigmoid function

Channel * FunctionGenerator::createGaussianBuffer ( sample  pControlParameter,
const math::Vector2< sample > &  pXRange,
const math::Vector2< sample > &  pYLimits,
unsigned int  pFrameCount 
) [protected]

create graussian function

Parameters:
pControlParameter control parameter ( 0.001 (narrow peak) - 0.2 (in between) - 1.0 ( broad peak ) )
pXRange x range
pYLimits y min and max values
pFrameCount frame count
Returns:
channel

Channel * FunctionGenerator::createHammingBuffer ( const math::Vector2< sample > &  pXRange,
const math::Vector2< sample > &  pYLimits,
unsigned int  pFrameCount 
) [protected]

create hamming function

Parameters:
pXRange x range
pYLimits y min and max values
pFrameCount frame count
Returns:
channel

Channel * FunctionGenerator::createHannBuffer ( const math::Vector2< sample > &  pXRange,
const math::Vector2< sample > &  pYLimits,
unsigned int  pFrameCount 
) [protected]

create han function

Parameters:
pXRange x range
pYLimits y min and max values
pFrameCount frame count
Returns:
channel

void FunctionGenerator::rescaleYRange ( Channel pChannel,
const math::Vector2< sample > &  pYLimits 
) [protected]

rescales sample values to lie within y min and max limits

Parameters:
pChannel channel whose samples are rescaled
pYLimits y min and max limits


Member Data Documentation

FunctionGenerator * FunctionGenerator::sFunctionGenerator [static, protected]

singleton instance member variable

unsigned int iso::synth::FunctionGenerator::mStandardFrameCount [protected]

default frame count for generated buffers

sample FunctionGenerator::sMaxY [static, protected]

max y value for rescaling

sample FunctionGenerator::sMinY [static, protected]

min y value for rescaling


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