38 DelayA( StkFloat delay = 0.5,
unsigned long maxDelay = 4095 );
66 StkFloat
getDelay(
void )
const {
return delay_; };
74 StkFloat
tapOut(
unsigned long tapDelay );
77 void tapIn( StkFloat value,
unsigned long tapDelay );
80 StkFloat
lastOut(
void )
const {
return lastFrame_[0]; };
89 StkFloat
tick( StkFloat input );
115 unsigned long inPoint_;
116 unsigned long outPoint_;
121 StkFloat nextOutput_;
125inline StkFloat DelayA :: nextOut(
void )
129 nextOutput_ = -coeff_ * lastFrame_[0];
130 nextOutput_ += apInput_ + ( coeff_ * inputs_[outPoint_] );
137inline StkFloat DelayA :: tick( StkFloat input )
139 inputs_[inPoint_++] = input * gain_;
142 if ( inPoint_ == inputs_.size() )
145 lastFrame_[0] = nextOut();
149 apInput_ = inputs_[outPoint_++];
150 if ( outPoint_ == inputs_.size() )
153 return lastFrame_[0];
158#if defined(_STK_DEBUG_)
159 if ( channel >= frames.
channels() ) {
160 oStream_ <<
"DelayA::tick(): channel and StkFrames arguments are incompatible!";
161 handleError( StkError::FUNCTION_ARGUMENT );
165 StkFloat *samples = &frames[channel];
166 unsigned int hop = frames.
channels();
167 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop ) {
168 inputs_[inPoint_++] = *samples * gain_;
169 if ( inPoint_ == inputs_.size() ) inPoint_ = 0;
170 *samples = nextOut();
171 lastFrame_[0] = *samples;
173 apInput_ = inputs_[outPoint_++];
174 if ( outPoint_ == inputs_.size() ) outPoint_ = 0;
182#if defined(_STK_DEBUG_)
184 oStream_ <<
"DelayA::tick(): channel and StkFrames arguments are incompatible!";
185 handleError( StkError::FUNCTION_ARGUMENT );
189 StkFloat *iSamples = &iFrames[iChannel];
190 StkFloat *oSamples = &oFrames[oChannel];
192 for (
unsigned int i=0; i<iFrames.
frames(); i++, iSamples += iHop, oSamples += oHop ) {
193 inputs_[inPoint_++] = *iSamples * gain_;
194 if ( inPoint_ == inputs_.size() ) inPoint_ = 0;
195 *oSamples = nextOut();
196 lastFrame_[0] = *oSamples;
198 apInput_ = inputs_[outPoint_++];
199 if ( outPoint_ == inputs_.size() ) outPoint_ = 0;
STK allpass interpolating delay line class.
Definition DelayA.h:29
StkFloat nextOut(void)
Return the value which will be output by the next call to tick().
Definition DelayA.h:125
unsigned long getMaximumDelay(void)
Get the maximum delay-line length.
Definition DelayA.h:47
void setDelay(StkFloat delay)
Set the delay-line length.
StkFloat getDelay(void) const
Return the current delay-line length.
Definition DelayA.h:66
DelayA(StkFloat delay=0.5, unsigned long maxDelay=4095)
Default constructor creates a delay-line with maximum length of 4095 samples and delay = 0....
StkFloat tapOut(unsigned long tapDelay)
Return the value at tapDelay samples from the delay-line input.
void setMaximumDelay(unsigned long delay)
Set the maximum delay-line length.
~DelayA()
Class destructor.
StkFloat lastOut(void) const
Return the last computed output value.
Definition DelayA.h:80
void tapIn(StkFloat value, unsigned long tapDelay)
Set the value at tapDelay samples from the delay-line input.
void clear(void)
Clears all internal states of the delay line.
StkFloat tick(StkFloat input)
Input one sample to the filter and return one output.
Definition DelayA.h:137
STK abstract filter class.
Definition Filter.h:23
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
size_t size() const
Returns the total number of audio samples represented by the object.
Definition Stk.h:374
The STK namespace.
Definition ADSR.h:6