25 OnePole( StkFloat thePole = 0.9 );
31 void setB0( StkFloat b0 ) { b_[0] = b0; };
34 void setA1( StkFloat a1 ) { a_[1] = a1; };
37 void setCoefficients( StkFloat b0, StkFloat a1,
bool clearState =
false );
48 void setPole( StkFloat thePole );
51 StkFloat
lastOut(
void )
const {
return lastFrame_[0]; };
54 StkFloat
tick( StkFloat input );
82 inputs_[0] = gain_ * input;
83 lastFrame_[0] = b_[0] * inputs_[0] - a_[1] * outputs_[1];
84 outputs_[1] = lastFrame_[0];
91 #if defined(_STK_DEBUG_)
92 if ( channel >= frames.
channels() ) {
93 oStream_ <<
"OnePole::tick(): channel and StkFrames arguments are incompatible!";
98 StkFloat *samples = &frames[channel];
99 unsigned int hop = frames.
channels();
100 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop ) {
101 inputs_[0] = gain_ * *samples;
102 *samples = b_[0] * inputs_[0] - a_[1] * outputs_[1];
103 outputs_[1] = *samples;
106 lastFrame_[0] = outputs_[1];
112 #if defined(_STK_DEBUG_)
114 oStream_ <<
"OnePole::tick(): channel and StkFrames arguments are incompatible!";
119 StkFloat *iSamples = &iFrames[iChannel];
120 StkFloat *oSamples = &oFrames[oChannel];
122 for (
unsigned int i=0; i<iFrames.
frames(); i++, iSamples += iHop, oSamples += oHop ) {
123 inputs_[0] = gain_ * *iSamples;
124 *oSamples = b_[0] * inputs_[0] - a_[1] * outputs_[1];
125 outputs_[1] = *oSamples;
128 lastFrame_[0] = outputs_[1];