#include <iso_synth_trigger_sample_unit.h>
Inherits iso::synth::InputUnit.
Inheritance diagram for iso::synth::TriggerSampleUnit:
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< sample > | mAmplitudes |
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< sample > | mReleaseDecrement |
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 > | mSampleStartFrame |
position within a samplebuffer to play at frame start | |
ControlPort * | mTrigger |
trigger control port | |
ControlPort * | mTranspose |
transpose control port | |
Static Protected Attributes | |
static unsigned int | sUnitCount |
total number of units created so far |
TriggerSampleUnit::TriggerSampleUnit | ( | ) | throw (SynthException) |
default constructor
TriggerSampleUnit::TriggerSampleUnit | ( | String | pFileName | ) | throw (SynthException) |
parameter based contructor
pFileName | sample file name |
TriggerSampleUnit::TriggerSampleUnit | ( | String | pFileName, | |
unsigned int | pChannelCount | |||
) | throw (SynthException) |
parameter based contructor
pFileName | sample file name | |
pChannelCount | number of channels |
TriggerSampleUnit::TriggerSampleUnit | ( | const String & | pName, | |
String | pFileName | |||
) | throw (SynthException) |
parameter based contructor
pName | unit name | |
pFileName | sample file name |
TriggerSampleUnit::TriggerSampleUnit | ( | const String & | pName, | |
String | pFileName, | |||
unsigned int | pChannelCount | |||
) | throw (SynthException) |
parameter based contructor
pName | unit name | |
pFileName | sample file name | |
pChannelCount | number of channels |
TriggerSampleUnit::TriggerSampleUnit | ( | const data::Values & | pValues | ) | throw (SynthException) |
values based constructor
pValues | unit values |
SynthException | failed to create unit |
TriggerSampleUnit::~TriggerSampleUnit | ( | ) | throw (SynthException) |
destructor
void TriggerSampleUnit::setSample | ( | String | pFileName, | |
unsigned int | pTargetChanIdx | |||
) | throw (SynthException) |
add a sample on the next channel
pFileName | file name of additional sample file | |
pTargetChanIdx | selects inro which of the channels the mono file audio data is read into |
SynthException | sample not found |
void TriggerSampleUnit::setSample | ( | String | pFileName, | |
unsigned int | pSrcChanIdx, | |||
unsigned int | pTargetChanIdx | |||
) | throw (SynthException) |
add a sample on the next channel
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 |
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
pPlayStartPosition | 0: beginning |
void TriggerSampleUnit::setPlayStopPosition | ( | Frame | pPlayStopPosition | ) |
set play stop position
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] |
String TriggerSampleUnit::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 TriggerSampleUnit::init | ( | const String & | pFileName | ) | throw (SynthException) [protected] |
called by constructor
pFileName | sample file name |
SynthException | failed to initialize unit |
const String TriggerSampleUnit::sClassName [static] |
unsigned int TriggerSampleUnit::sUnitCount [static, protected] |
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