4 const unsigned long TABLE_SIZE = 2048;
41 void setRate( StkFloat rate ) { rate_ = rate; };
71 StkFloat
lastOut(
void )
const {
return lastFrame_[0]; };
74 StkFloat
tick(
void );
88 void sampleRateChanged( StkFloat newRate, StkFloat oldRate );
93 StkFloat phaseOffset_;
103 while ( time_ < 0.0 )
105 while ( time_ >= TABLE_SIZE )
108 iIndex_ = (
unsigned int) time_;
109 alpha_ = time_ - iIndex_;
110 StkFloat tmp = table_[ iIndex_ ];
111 tmp += ( alpha_ * ( table_[ iIndex_ + 1 ] - tmp ) );
117 return lastFrame_[0];
122 #if defined(_STK_DEBUG_)
123 if ( channel >= frames.
channels() ) {
124 oStream_ <<
"SineWave::tick(): channel and StkFrames arguments are incompatible!";
129 StkFloat *samples = &frames[channel];
132 unsigned int hop = frames.
channels();
133 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop ) {
137 while ( time_ < 0.0 )
139 while ( time_ >= TABLE_SIZE )
142 iIndex_ = (
unsigned int) time_;
143 alpha_ = time_ - iIndex_;
144 tmp = table_[ iIndex_ ];
145 tmp += ( alpha_ * ( table_[ iIndex_ + 1 ] - tmp ) );