28 StkFloat
tick( StkFloat input );
54inline StkFloat JetTable :: tick( StkFloat input )
59 lastFrame_[0] = input * (input * input - 1.0);
62 if ( lastFrame_[0] > 1.0 ) lastFrame_[0] = 1.0;
63 if ( lastFrame_[0] < -1.0 ) lastFrame_[0] = -1.0;
69#if defined(_STK_DEBUG_)
70 if ( channel >= frames.
channels() ) {
71 oStream_ <<
"JetTable::tick(): channel and StkFrames arguments are incompatible!";
72 handleError( StkError::FUNCTION_ARGUMENT );
76 StkFloat *samples = &frames[channel];
77 unsigned int hop = frames.
channels();
78 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop ) {
79 *samples = *samples * (*samples * *samples - 1.0);
80 if ( *samples > 1.0) *samples = 1.0;
81 if ( *samples < -1.0) *samples = -1.0;
84 lastFrame_[0] = *(samples-hop);
90#if defined(_STK_DEBUG_)
92 oStream_ <<
"JetTable::tick(): channel and StkFrames arguments are incompatible!";
93 handleError( StkError::FUNCTION_ARGUMENT );
97 StkFloat *iSamples = &iFrames[iChannel];
98 StkFloat *oSamples = &oFrames[oChannel];
100 for (
unsigned int i=0; i<iFrames.
frames(); i++, iSamples += iHop, oSamples += oHop ) {
101 *oSamples = *oSamples * (*oSamples * *oSamples - 1.0);
102 if ( *oSamples > 1.0) *oSamples = 1.0;
103 if ( *oSamples < -1.0) *oSamples = -1.0;
106 lastFrame_[0] = *(oSamples-oHop);
STK abstract function parent class.
Definition Function.h:21
STK jet table class.
Definition JetTable.h:24
StkFloat tick(StkFloat input)
Take one sample input and map to one sample of output.
Definition JetTable.h:54
An STK class to handle vectorized audio data.
Definition Stk.h:279
unsigned int channels(void) const
Return the number of channels represented by the data.
Definition Stk.h:416
unsigned int frames(void) const
Return the number of sample frames represented by the data.
Definition Stk.h:419
The STK namespace.
Definition ADSR.h:6