38 Twang( StkFloat lowestFrequency = 50.0 );
74 StkFloat
lastOut(
void ) {
return lastOutput_; };
77 StkFloat
tick( StkFloat input );
107 StkFloat lastOutput_;
110 StkFloat pluckPosition_;
115 lastOutput_ = delayLine_.
tick( input + loopFilter_.
tick( delayLine_.
lastOut() ) );
116 lastOutput_ -= combDelay_.
tick( lastOutput_ );
124 #if defined(_STK_DEBUG_)
125 if ( channel >= frames.
channels() ) {
126 oStream_ <<
"Twang::tick(): channel and StkFrames arguments are incompatible!";
131 StkFloat *samples = &frames[channel];
132 unsigned int hop = frames.
channels();
133 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop )
134 *samples =
tick( *samples );
141 #if defined(_STK_DEBUG_)
143 oStream_ <<
"Twang::tick(): channel and StkFrames arguments are incompatible!";
148 StkFloat *iSamples = &iFrames[iChannel];
149 StkFloat *oSamples = &oFrames[oChannel];
151 for (
unsigned int i=0; i<iFrames.
frames(); i++, iSamples += iHop, oSamples += oHop )
152 *oSamples =
tick( *iSamples );
STK allpass interpolating delay line class.
Definition: DelayA.h:29
StkFloat lastOut(void) const
Return the last computed output value.
Definition: DelayA.h:80
StkFloat tick(StkFloat input)
Input one sample to the filter and return one output.
Definition: DelayA.h:137
STK linear interpolating delay line class.
Definition: DelayL.h:28
StkFloat tick(StkFloat input)
Input one sample to the filter and return one output.
Definition: DelayL.h:163
STK general finite impulse response filter class.
Definition: Fir.h:31
StkFloat tick(StkFloat input)
Input one sample to the filter and return one output.
Definition: Fir.h:86
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
STK base class.
Definition: Stk.h:144
static void handleError(const char *message, StkError::Type type)
Static function for error reporting and handling using c-strings.
STK enhanced plucked string class.
Definition: Twang.h:35
void setFrequency(StkFloat frequency)
Set the delayline parameters for a particular frequency.
StkFloat tick(StkFloat input)
Compute and return one output sample.
Definition: Twang.h:113
void setPluckPosition(StkFloat position)
Set the pluck or "excitation" position along the string (0.0 - 1.0).
void setLoopFilter(std::vector< StkFloat > coefficients)
Set the loop filter coefficients.
void clear(void)
Reset and clear all internal state.
Twang(StkFloat lowestFrequency=50.0)
Class constructor, taking the lowest desired playing frequency.
StkFloat lastOut(void)
Return an StkFrames reference to the last output sample frame.
Definition: Twang.h:74
void setLoopGain(StkFloat loopGain)
Set the nominal loop gain.
void setLowestFrequency(StkFloat frequency)
Set the delayline parameters to allow frequencies as low as specified.
The STK namespace.
Definition: ADSR.h:8