#include <iso_synth_pulse_unit.h>
Inherits iso::synth::InputUnit.
Inheritance diagram for iso::synth::PulseUnit:
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 | |
ControlPort * | mAmplitude |
pulse amplitude control port | |
ControlPort * | mInterval |
pulse interval control port (intervals in milisecs) | |
ControlPort * | mAmplitudeRand |
amplitude randomization control port | |
ControlPort * | mIntervalRand |
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 |
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.
PulseUnit::PulseUnit | ( | ) |
default constructor
PulseUnit::PulseUnit | ( | const String & | pName | ) |
parameter based contructor
pName | unit name |
PulseUnit::PulseUnit | ( | unsigned int | pChannelCount | ) |
parameter based contructor
pChannelCount | number of channels |
PulseUnit::PulseUnit | ( | const String & | pName, | |
unsigned int | pChannelCount | |||
) |
parameter based contructor
pName | unit name | |
pChannelCount | number of channels |
PulseUnit::PulseUnit | ( | 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 |
PulseUnit::PulseUnit | ( | const String & | pName, | |
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 |
PulseUnit::PulseUnit | ( | const PulseUnit & | pUnit | ) |
copy constructor
pUnit | unit to copy properties from |
name & copy constructor
pName | unit name | |
pUnit | unit to copy properties from |
PulseUnit::PulseUnit | ( | const data::Values & | pValues | ) | throw (SynthException) |
values based constructor
pValues | unit values |
SynthException | failed to create unit |
PulseUnit::~PulseUnit | ( | ) |
destructor
void PulseUnit::process | ( | Buffer * | pBuffer | ) | throw (SynthException) [virtual] |
void PulseUnit::processFM | ( | Buffer * | pBuffer | ) | [virtual] |
processes buffer (frame mode)
pBuffer | buffer to process |
void PulseUnit::processBM | ( | Buffer * | pBuffer | ) | [virtual] |
processes buffer (buffer mode)
pBuffer | buffer to process |
String PulseUnit::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 PulseUnit::init | ( | ) | [protected] |
initializes wavetable and control ports
std::ostream& operator<< | ( | std::ostream & | pOstream, | |
const PulseUnit & | pUnit | |||
) | [friend] |
print unit information
const String PulseUnit::sClassName [static] |
unsigned int PulseUnit::sUnitCount [static, protected] |
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