37 DelayL( StkFloat delay = 0.0,
unsigned long maxDelay = 4095 );
62 StkFloat
getDelay(
void )
const {
return delay_; };
70 StkFloat
tapOut(
unsigned long tapDelay );
73 void tapIn( StkFloat value,
unsigned long tapDelay );
76 StkFloat
lastOut(
void )
const {
return lastFrame_[0]; };
85 StkFloat
tick( StkFloat input );
111 unsigned long inPoint_;
112 unsigned long outPoint_;
116 StkFloat nextOutput_;
124 nextOutput_ = inputs_[outPoint_] * omAlpha_;
126 if (outPoint_+1 < inputs_.
size())
127 nextOutput_ += inputs_[outPoint_+1] * alpha_;
129 nextOutput_ += inputs_[0] * alpha_;
138 inputs_[inPoint_++] = input * gain_;
141 if ( inPoint_ == inputs_.
size() )
148 if ( ++outPoint_ == inputs_.
size() )
151 return lastFrame_[0];
156 #if defined(_STK_DEBUG_)
157 if ( channel >= frames.
channels() ) {
158 oStream_ <<
"DelayL::tick(): channel and StkFrames arguments are incompatible!";
163 StkFloat *samples = &frames[channel];
164 unsigned int hop = frames.
channels();
165 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop ) {
166 inputs_[inPoint_++] = *samples * gain_;
167 if ( inPoint_ == inputs_.
size() ) inPoint_ = 0;
170 if ( ++outPoint_ == inputs_.
size() ) outPoint_ = 0;
173 lastFrame_[0] = *(samples-hop);
179 #if defined(_STK_DEBUG_)
181 oStream_ <<
"DelayL::tick(): channel and StkFrames arguments are incompatible!";
186 StkFloat *iSamples = &iFrames[iChannel];
187 StkFloat *oSamples = &oFrames[oChannel];
189 for (
unsigned int i=0; i<iFrames.
frames(); i++, iSamples += iHop, oSamples += oHop ) {
190 inputs_[inPoint_++] = *iSamples * gain_;
191 if ( inPoint_ == inputs_.
size() ) inPoint_ = 0;
194 if ( ++outPoint_ == inputs_.
size() ) outPoint_ = 0;
197 lastFrame_[0] = *(oSamples-oHop);