iso::synth::PulseUnit Class Reference

PulseUnit pulse unit class. More...

#include <iso_synth_pulse_unit.h>

Inherits iso::synth::InputUnit.

Inheritance diagram for iso::synth::PulseUnit:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PulseUnit ()
 default constructor
 PulseUnit (const String &pName)
 parameter based contructor
 PulseUnit (unsigned int pChannelCount)
 parameter based contructor
 PulseUnit (const String &pName, unsigned int pChannelCount)
 parameter based contructor
 PulseUnit (unsigned int pFrameCount, unsigned int pChannelCount, unsigned int pRate) throw (SynthException)
 parameter based contructor
 PulseUnit (const String &pName, unsigned int pFrameCount, unsigned int pChannelCount, unsigned int pRate) throw (SynthException)
 name and parameter based contructor
 PulseUnit (const PulseUnit &pUnit)
 copy constructor
 PulseUnit (const String &pName, const PulseUnit &pUnit)
 name & copy constructor
 PulseUnit (const data::Values &pValues) throw (SynthException)
 values based constructor
 ~PulseUnit ()
 destructor
virtual void process (Buffer *pBuffer) throw (SynthException)
 processes buffer
virtual void processFM (Buffer *pBuffer)
 processes buffer (frame mode)
virtual void processBM (Buffer *pBuffer)
 processes buffer (buffer mode)
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

void init ()
 initializes wavetable and control ports

Protected Attributes

ControlPortmAmplitude
 pulse amplitude control port
ControlPortmInterval
 pulse interval control port (intervals in milisecs)
ControlPortmAmplitudeRand
 amplitude randomization control port
ControlPortmIntervalRand
 interval randomization control port
Frame mIntervalCounter
 interval counter (intervals in milisecs)
sample mMili2FrameScale
 milisecs to frame scale factor
sample mSampleDuration
 frame to milisecs scale factor

Static Protected Attributes

static unsigned int sUnitCount
 total number of units created so far

Friends

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

Detailed Description

PulseUnit pulse unit class.

class

This unit creates single sample wide pulses.
These pulses are not bandlimited.
The main application of this unit is not in generating sound but in triggering events that need to be sample accurate.
It therefore acts as a complement to the normal event system.
This unit is usually connected to a PulseToValue unit, which transforms the pulses into values that can for example be used to adjust control ports.
It also serves as a grain trigger system of the GranularUnit in granular synthesis.
Both the ampitude of the pulses and the pulse intervals can either be fixed or random.
The amount of randomization is set by the corresponding control ports (amplitudeRand and intervalRand).
Randomization values range from 0.0 to 1.0 where 0.0 means no randomization and 1.0 means maximum randomization.
Randomization is always proportional to the amplitude and interval settings of the control ports.


ControlPorts
name: amplitude defaultValue: 1.0
name: interval defaultValue: 1.0
name: amplitudeRand defaultValue: 0.0
name: intervalRand defaultValue: 0.0

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


Created by Daniel Bisig on 6/7/07.


Constructor & Destructor Documentation

PulseUnit::PulseUnit (  ) 

default constructor

PulseUnit::PulseUnit ( const String pName  ) 

parameter based contructor

Parameters:
pName unit name

PulseUnit::PulseUnit ( unsigned int  pChannelCount  ) 

parameter based contructor

Parameters:
pChannelCount number of channels

PulseUnit::PulseUnit ( const String pName,
unsigned int  pChannelCount 
)

parameter based contructor

Parameters:
pName unit name
pChannelCount number of channels

PulseUnit::PulseUnit ( 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

PulseUnit::PulseUnit ( const String pName,
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

PulseUnit::PulseUnit ( const PulseUnit pUnit  ) 

copy constructor

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

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

name & copy constructor

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

PulseUnit::PulseUnit ( 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: unsigned int : number of frames 2: unsigned int : number of channels 3: unsigned int : samping rate

PulseUnit::~PulseUnit (  ) 

destructor


Member Function Documentation

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

processes buffer

Parameters:
pBuffer buffer to process

Reimplemented from iso::synth::InputUnit.

void PulseUnit::processFM ( Buffer pBuffer  )  [virtual]

processes buffer (frame mode)

Parameters:
pBuffer buffer to process

void PulseUnit::processBM ( Buffer pBuffer  )  [virtual]

processes buffer (buffer mode)

Parameters:
pBuffer buffer to process

String PulseUnit::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 PulseUnit::init (  )  [protected]

initializes wavetable and control ports


Friends And Related Function Documentation

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

print unit information


Member Data Documentation

const String PulseUnit::sClassName [static]

default name

Reimplemented from iso::synth::InputUnit.

unsigned int PulseUnit::sUnitCount [static, protected]

total number of units created so far

Reimplemented from iso::synth::InputUnit.

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

pulse amplitude control port

ControlPort* iso::synth::PulseUnit::mInterval [protected]

pulse interval control port (intervals in milisecs)

ControlPort* iso::synth::PulseUnit::mAmplitudeRand [protected]

amplitude randomization control port

ControlPort* iso::synth::PulseUnit::mIntervalRand [protected]

interval randomization control port

Frame iso::synth::PulseUnit::mIntervalCounter [protected]

interval counter (intervals in milisecs)

sample iso::synth::PulseUnit::mMili2FrameScale [protected]

milisecs to frame scale factor

sample iso::synth::PulseUnit::mSampleDuration [protected]

frame to milisecs scale factor


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