1 #ifndef STK_REEDTABLE_H
2 #define STK_REEDTABLE_H
39 void setOffset( StkFloat offset ) { offset_ = offset; };
47 void setSlope( StkFloat slope ) { slope_ = slope; };
50 StkFloat
tick( StkFloat input );
84 lastFrame_[0] = offset_ + (slope_ * input);
88 if ( lastFrame_[0] > 1.0) lastFrame_[0] = (StkFloat) 1.0;
93 if ( lastFrame_[0] < -1.0) lastFrame_[0] = (StkFloat) -1.0;
100 #if defined(_STK_DEBUG_)
101 if ( channel >= frames.
channels() ) {
102 oStream_ <<
"ReedTable::tick(): channel and StkFrames arguments are incompatible!";
107 StkFloat *samples = &frames[channel];
108 unsigned int hop = frames.
channels();
109 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop ) {
110 *samples = offset_ + (slope_ * *samples);
111 if ( *samples > 1.0) *samples = 1.0;
112 if ( *samples < -1.0) *samples = -1.0;
115 lastFrame_[0] = *(samples-hop);
121 #if defined(_STK_DEBUG_)
123 oStream_ <<
"ReedTable::tick(): channel and StkFrames arguments are incompatible!";
128 StkFloat *iSamples = &iFrames[iChannel];
129 StkFloat *oSamples = &oFrames[oChannel];
131 for (
unsigned int i=0; i<iFrames.
frames(); i++, iSamples += iHop, oSamples += oHop ) {
132 *oSamples = offset_ + (slope_ * *iSamples);
133 if ( *oSamples > 1.0) *oSamples = 1.0;
134 if ( *oSamples < -1.0) *oSamples = -1.0;
137 lastFrame_[0] = *(oSamples-oHop);