ofxPDSP
pdsp::DataTable Class Reference

Utility class for creating waveform from realtime data, thread safely. More...

#include <DataTable.h>

Public Member Functions

void smoothing (float value)
 activate the smoothing of the transition to the new setted waves More...
 
void harmonicAdditiveMode (bool active)
 when setting the data with additive synthesis, scales the harmonics to the saw wave ratio More...
 
int getTableLength () const
 returns the lenght of each wave buffer
 
int getMaxPartials () const
 returns the number of partials you can set
 
void setup (int len, int maxPartials=64, bool harmonicAdditive=true)
 sets the table length, and the maximum number of partial. More...
 
bool ready ()
 checks if you can set the wave, always use it for thread-safe operations
 
void begin ()
 begins the setting of the data vector. Check if the DataTable is ready() before calling it
 
void data (int i, float value)
 sets a value in the data vector. Not setted values are set to 0.0f. More...
 
void end (bool additive=false)
 end the data vector setting. Transform the values in the vector in a waveform. If the parameter is true the wave is set using additive synthesis, each data value is the amplitude of a partial, by default the partial are also scaled to the harmonic ratio. If the parameter is false the values is interpreted as raw waveform. Beware that if you are setting directly a waveform you could cause a DC offset. More...
 

Friends

class DataOsc
 

Detailed Description

Utility class for creating waveform from realtime data, thread safely.

Member Function Documentation

◆ data()

void pdsp::DataTable::data ( int  i,
float  value 
)

sets a value in the data vector. Not setted values are set to 0.0f.

Parameters
[in]iindex of the value
[in]valuedata value. Use values in the -1.0f<–>1.0f range

◆ end()

void pdsp::DataTable::end ( bool  additive = false)

end the data vector setting. Transform the values in the vector in a waveform. If the parameter is true the wave is set using additive synthesis, each data value is the amplitude of a partial, by default the partial are also scaled to the harmonic ratio. If the parameter is false the values is interpreted as raw waveform. Beware that if you are setting directly a waveform you could cause a DC offset.

Parameters
[in]additiveif true the wave is set using additive synthesis, otherwive the data is interpreted as raw waveform, false by default

◆ harmonicAdditiveMode()

void pdsp::DataTable::harmonicAdditiveMode ( bool  active)

when setting the data with additive synthesis, scales the harmonics to the saw wave ratio

Parameters
[in]activeactivate the harmonic scaling, it is active by default

◆ setup()

void pdsp::DataTable::setup ( int  len,
int  maxPartials = 64,
bool  harmonicAdditive = true 
)

sets the table length, and the maximum number of partial.

Parameters
[in]lenlength of each wave sample buffer
[in]maxPartialsmax number of partials available for the waves. 64 if not given.
[in]harmonicAdditivemode for additive synthesis. true if not given.

◆ smoothing()

void pdsp::DataTable::smoothing ( float  value)

activate the smoothing of the transition to the new setted waves

Parameters
[in]valuea value in the 0.0f-0.9999f (boundary checked). 0.0f deactivate smoothing

The documentation for this class was generated from the following files: