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);
static void handleError(const char *message, StkError::Type type)
Static function for error reporting and handling using c-strings.
void setDelay(StkFloat delay)
Set the delay-line length.
unsigned int frames(void) const
Return the number of sample frames represented by the data.
Definition: Stk.h:380
unsigned long getMaximumDelay(void)
Get the maximum delay-line length.
Definition: DelayL.h:43
STK abstract filter class.
Definition: Filter.h:22
void tapIn(StkFloat value, unsigned long tapDelay)
Set the value at tapDelay samples from the delay-line input.
The STK namespace.
Definition: ADSR.h:6
StkFloat getDelay(void) const
Return the current delay-line length.
Definition: DelayL.h:62
size_t size() const
Returns the total number of audio samples represented by the object.
Definition: Stk.h:351
DelayL(StkFloat delay=0.0, unsigned long maxDelay=4095)
Default constructor creates a delay-line with maximum length of 4095 samples and zero delay...
void setMaximumDelay(unsigned long delay)
Set the maximum delay-line length.
StkFloat lastOut(void) const
Return the last computed output value.
Definition: DelayL.h:76
StkFloat tick(StkFloat input)
Input one sample to the filter and return one output.
Definition: DelayL.h:136
~DelayL()
Class destructor.
STK linear interpolating delay line class.
Definition: DelayL.h:27
unsigned int channels(void) const
Return the number of channels represented by the data.
Definition: Stk.h:377
An STK class to handle vectorized audio data.
Definition: Stk.h:272
StkFloat nextOut(void)
Return the value which will be output by the next call to tick().
Definition: DelayL.h:120
StkFloat tapOut(unsigned long tapDelay)
Return the value at tapDelay samples from the delay-line input.