iso::synth::TriggerSampleUnit Class Reference

#include <iso_synth_trigger_sample_unit.h>

Inherits iso::synth::InputUnit.

Inheritance diagram for iso::synth::TriggerSampleUnit:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TriggerSampleUnit () throw (SynthException)
 default constructor
 TriggerSampleUnit (String pFileName) throw (SynthException)
 parameter based contructor
 TriggerSampleUnit (String pFileName, unsigned int pChannelCount) throw (SynthException)
 parameter based contructor
 TriggerSampleUnit (const String &pName, String pFileName) throw (SynthException)
 parameter based contructor
 TriggerSampleUnit (const String &pName, String pFileName, unsigned int pChannelCount) throw (SynthException)
 parameter based contructor
 TriggerSampleUnit (const data::Values &pValues) throw (SynthException)
 values based constructor
 ~TriggerSampleUnit () throw (SynthException)
 destructor
void setSample (String pFileName, unsigned int pTargetChanIdx) throw (SynthException)
 add a sample on the next channel
void setSample (String pFileName, unsigned int pSrcChanIdx, unsigned int pTargetChanIdx) throw (SynthException)
 add a sample on the next channel
void setPlayStartPosition (Frame pPlayStartPosition)
 set start positions in ms within the loaded samples (multichannel set method). use "NAN" for the frame values that should be ignored. e.g. Frame(4, NAN, NAN, 0.5, NAN) will only set the third channel to 0.5
void setPlayStopPosition (Frame pPlayStopPosition)
 set play stop position
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

void init (const String &pFileName) throw (SynthException)
 called by constructor

Protected Attributes

QVector< unsigned int > mPlayStartPosition
 play start position in sound file (in sample values, not ms!)
QVector< unsigned int > mPlayStopPosition
 play stop position in sound file (in sample values)
QVector< samplemAmplitudes
 current amplitude as specified by the last trigger point and possibly updated by decrementing it with mReleaseDecrement
QVector< Channel * > mSampleBuffers
 sound files audio data per channel (QVector=chan, Channel=Audio data)
QVector< samplemReleaseDecrement
 release amplitude decrement per sample (20 * amplitude * -triggerval) / sample_rate explanation: release time in secs = 1 / (20 * -triggervalue)
decrement = amplitude / (sample_rate * release_time)
QVector< samplemSampleStartFrame
 position within a samplebuffer to play at frame start
ControlPortmTrigger
 trigger control port
ControlPortmTranspose
 transpose control port

Static Protected Attributes

static unsigned int sUnitCount
 total number of units created so far

Constructor & Destructor Documentation

TriggerSampleUnit::TriggerSampleUnit (  )  throw (SynthException)

default constructor

TriggerSampleUnit::TriggerSampleUnit ( String  pFileName  )  throw (SynthException)

parameter based contructor

Parameters:
pFileName sample file name

TriggerSampleUnit::TriggerSampleUnit ( String  pFileName,
unsigned int  pChannelCount 
) throw (SynthException)

parameter based contructor

Parameters:
pFileName sample file name
pChannelCount number of channels

TriggerSampleUnit::TriggerSampleUnit ( const String pName,
String  pFileName 
) throw (SynthException)

parameter based contructor

Parameters:
pName unit name
pFileName sample file name

TriggerSampleUnit::TriggerSampleUnit ( const String pName,
String  pFileName,
unsigned int  pChannelCount 
) throw (SynthException)

parameter based contructor

Parameters:
pName unit name
pFileName sample file name
pChannelCount number of channels

TriggerSampleUnit::TriggerSampleUnit ( 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: const String& : sample file name 2: unsigned int : number of channels

TriggerSampleUnit::~TriggerSampleUnit (  )  throw (SynthException)

destructor


Member Function Documentation

void TriggerSampleUnit::setSample ( String  pFileName,
unsigned int  pTargetChanIdx 
) throw (SynthException)

add a sample on the next channel

Parameters:
pFileName file name of additional sample file
pTargetChanIdx selects inro which of the channels the mono file audio data is read into
Exceptions:
SynthException sample not found

void TriggerSampleUnit::setSample ( String  pFileName,
unsigned int  pSrcChanIdx,
unsigned int  pTargetChanIdx 
) throw (SynthException)

add a sample on the next channel

Parameters:
pFileName file name of additional sample file
pSrcChanIdx selects which of the channels from the file should be read out
pTargetChanIdx selects inro which of the channels the mono file audio data is read into
Exceptions:
sample not found

void TriggerSampleUnit::setPlayStartPosition ( Frame  pPlayStartPosition  ) 

set start positions in ms within the loaded samples (multichannel set method). use "NAN" for the frame values that should be ignored. e.g. Frame(4, NAN, NAN, 0.5, NAN) will only set the third channel to 0.5

Parameters:
pPlayStartPosition 0: beginning

void TriggerSampleUnit::setPlayStopPosition ( Frame  pPlayStopPosition  ) 

set play stop position

Parameters:
pPlayStopPosition play stop positions (in milisecs) for all channels. use "NAN" for the frame values that should be ignored. e.g. Frame(4, NAN, NAN, 0.5, NAN) will only set the third channel to 0.5

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

processes buffer

Parameters:
pBuffer buffer to process

Reimplemented from iso::synth::InputUnit.

String TriggerSampleUnit::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 TriggerSampleUnit::init ( const String pFileName  )  throw (SynthException) [protected]

called by constructor

Parameters:
pFileName sample file name
Exceptions:
SynthException failed to initialize unit


Member Data Documentation

const String TriggerSampleUnit::sClassName [static]

default name

Reimplemented from iso::synth::InputUnit.

unsigned int TriggerSampleUnit::sUnitCount [static, protected]

total number of units created so far

Reimplemented from iso::synth::InputUnit.

QVector<unsigned int> iso::synth::TriggerSampleUnit::mPlayStartPosition [protected]

play start position in sound file (in sample values, not ms!)

QVector<unsigned int> iso::synth::TriggerSampleUnit::mPlayStopPosition [protected]

play stop position in sound file (in sample values)

QVector<sample> iso::synth::TriggerSampleUnit::mAmplitudes [protected]

current amplitude as specified by the last trigger point and possibly updated by decrementing it with mReleaseDecrement

QVector<Channel*> iso::synth::TriggerSampleUnit::mSampleBuffers [protected]

sound files audio data per channel (QVector=chan, Channel=Audio data)

QVector<sample> iso::synth::TriggerSampleUnit::mReleaseDecrement [protected]

release amplitude decrement per sample (20 * amplitude * -triggerval) / sample_rate explanation: release time in secs = 1 / (20 * -triggervalue)
decrement = amplitude / (sample_rate * release_time)

QVector<sample> iso::synth::TriggerSampleUnit::mSampleStartFrame [protected]

position within a samplebuffer to play at frame start

ControlPort* iso::synth::TriggerSampleUnit::mTrigger [protected]

trigger control port

ControlPort* iso::synth::TriggerSampleUnit::mTranspose [protected]

transpose control port


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