38 StkFloat
lastOut(
void )
const {
return lastFrame_[0]; };
41 StkFloat
tick( StkFloat input );
68 unsigned long length_;
72inline StkFloat Echo :: tick( StkFloat input )
74 lastFrame_[0] = effectMix_ * ( delayLine_.tick( input ) - input ) + input;
80#if defined(_STK_DEBUG_)
81 if ( channel >= frames.
channels() ) {
82 oStream_ <<
"Echo::tick(): channel and StkFrames arguments are incompatible!";
83 handleError( StkError::FUNCTION_ARGUMENT );
87 StkFloat *samples = &frames[channel];
88 unsigned int hop = frames.
channels();
89 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop ) {
90 *samples = effectMix_ * ( delayLine_.tick( *samples ) - *samples ) + *samples;
93 lastFrame_[0] = *(samples-hop);
99#if defined(_STK_DEBUG_)
101 oStream_ <<
"Echo::tick(): channel and StkFrames arguments are incompatible!";
102 handleError( StkError::FUNCTION_ARGUMENT );
106 StkFloat *iSamples = &iFrames[iChannel];
107 StkFloat *oSamples = &oFrames[oChannel];
109 for (
unsigned int i=0; i<iFrames.
frames(); i++, iSamples += iHop, oSamples += oHop ) {
110 *oSamples = effectMix_ * ( delayLine_.tick( *iSamples ) - *iSamples ) + *iSamples;
113 lastFrame_[0] = *(oSamples-oHop);
STK non-interpolating delay line class.
Definition Delay.h:25
STK echo effect class.
Definition Echo.h:20
void clear()
Reset and clear all internal state.
StkFloat lastOut(void) const
Return the last computed output value.
Definition Echo.h:38
void setMaximumDelay(unsigned long delay)
Set the maximum delay line length in samples.
StkFloat tick(StkFloat input)
Input one sample to the effect and return one output.
Definition Echo.h:72
Echo(unsigned long maximumDelay=(unsigned long) Stk::sampleRate())
Class constructor, taking the longest desired delay length (one second default value).
void setDelay(unsigned long delay)
Set the delay line length in samples.
STK abstract effects parent class.
Definition Effect.h:22
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
static StkFloat sampleRate(void)
Static method that returns the current STK sample rate.
Definition Stk.h:148
The STK namespace.
Definition ADSR.h:6