38 StkFloat
lastOut(
void )
const {
return lastFrame_[0]; };
41 StkFloat
tick( StkFloat input,
unsigned int channel){
46 StkFloat
tick( StkFloat input );
73 unsigned long length_;
77inline StkFloat Echo :: tick( StkFloat input )
79 lastFrame_[0] = effectMix_ * ( delayLine_.tick( input ) - input ) + input;
85#if defined(_STK_DEBUG_)
86 if ( channel >= frames.
channels() ) {
87 oStream_ <<
"Echo::tick(): channel and StkFrames arguments are incompatible!";
92 StkFloat *samples = &frames[channel];
93 unsigned int hop = frames.
channels();
94 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop ) {
95 *samples = effectMix_ * ( delayLine_.tick( *samples ) - *samples ) + *samples;
98 lastFrame_[0] = *(samples-hop);
104#if defined(_STK_DEBUG_)
106 oStream_ <<
"Echo::tick(): channel and StkFrames arguments are incompatible!";
111 StkFloat *iSamples = &iFrames[iChannel];
112 StkFloat *oSamples = &oFrames[oChannel];
114 for (
unsigned int i=0; i<iFrames.
frames(); i++, iSamples += iHop, oSamples += oHop ) {
115 *oSamples = effectMix_ * ( delayLine_.tick( *iSamples ) - *iSamples ) + *iSamples;
118 lastFrame_[0] = *(oSamples-oHop);
STK non-interpolating delay line class.
Definition Delay.h:25
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.
Echo(unsigned long maximumDelay=(unsigned long) Stk::sampleRate())
Class constructor, taking the longest desired delay length (one second default value).
StkFloat tick(StkFloat input, unsigned int channel)
Input one sample to the effect and return one output.
Definition Echo.h:41
void setDelay(unsigned long delay)
Set the delay line length in samples.
Effect(void)
Class constructor.
Definition Effect.h:25
An STK class to handle vectorized audio data.
Definition Stk.h:287
unsigned int channels(void) const
Return the number of channels represented by the data.
Definition Stk.h:415
unsigned int frames(void) const
Return the number of sample frames represented by the data.
Definition Stk.h:418
static void handleError(const char *message, StkError::Type type)
Static function for error reporting and handling using c-strings.
static StkFloat sampleRate(void)
Static method that returns the current STK sample rate.
Definition Stk.h:156
The STK namespace.
Definition ADSR.h:8