29 NRev( StkFloat T60 = 1.0 );
46 StkFloat
lastOut(
unsigned int channel = 0 );
56 StkFloat
tick( StkFloat input,
unsigned int channel = 0 );
84 Delay allpassDelays_[8];
86 StkFloat allpassCoefficient_;
87 StkFloat combCoefficient_[6];
88 StkFloat lowpassState_;
92inline StkFloat NRev :: lastOut(
unsigned int channel )
94#if defined(_STK_DEBUG_)
96 oStream_ <<
"NRev::lastOut(): channel argument must be less than 2!";
97 handleError( StkError::FUNCTION_ARGUMENT );
101 return lastFrame_[channel];
104inline StkFloat NRev :: tick( StkFloat input,
unsigned int channel )
106#if defined(_STK_DEBUG_)
108 oStream_ <<
"NRev::tick(): channel argument must be less than 2!";
109 handleError( StkError::FUNCTION_ARGUMENT );
113 StkFloat temp, temp0, temp1, temp2, temp3;
117 for ( i=0; i<6; i++ ) {
118 temp = input + (combCoefficient_[i] * combDelays_[i].lastOut());
119 temp0 += combDelays_[i].tick(temp);
122 for ( i=0; i<3; i++ ) {
123 temp = allpassDelays_[i].lastOut();
124 temp1 = allpassCoefficient_ * temp;
126 allpassDelays_[i].tick(temp1);
127 temp0 = -(allpassCoefficient_ * temp1) + temp;
131 lowpassState_ = 0.7 * lowpassState_ + 0.3 * temp0;
132 temp = allpassDelays_[3].lastOut();
133 temp1 = allpassCoefficient_ * temp;
134 temp1 += lowpassState_;
135 allpassDelays_[3].tick( temp1 );
136 temp1 = -( allpassCoefficient_ * temp1 ) + temp;
138 temp = allpassDelays_[4].lastOut();
139 temp2 = allpassCoefficient_ * temp;
141 allpassDelays_[4].tick( temp2 );
142 lastFrame_[0] = effectMix_*( -( allpassCoefficient_ * temp2 ) + temp );
144 temp = allpassDelays_[5].lastOut();
145 temp3 = allpassCoefficient_ * temp;
147 allpassDelays_[5].tick( temp3 );
148 lastFrame_[1] = effectMix_*( - ( allpassCoefficient_ * temp3 ) + temp );
150 temp = ( 1.0 - effectMix_ ) * input;
151 lastFrame_[0] += temp;
152 lastFrame_[1] += temp;
154 return lastFrame_[channel];
STK non-interpolating delay line class.
Definition Delay.h:25
STK abstract effects parent class.
Definition Effect.h:22
CCRMA's NRev reverberator class.
Definition NRev.h:26
void clear(void)
Reset and clear all internal state.
NRev(StkFloat T60=1.0)
Class constructor taking a T60 decay time argument (one second default value).
void setT60(StkFloat T60)
Set the reverberation T60 decay time.
StkFloat lastOut(unsigned int channel=0)
Return the specified channel value of the last computed stereo frame.
Definition NRev.h:92
StkFrames & tick(StkFrames &frames, unsigned int channel=0)
Take a channel of the StkFrames object as inputs to the effect and replace with stereo outputs.
StkFloat tick(StkFloat input, unsigned int channel=0)
Input one sample to the effect and return the specified channel value of the computed stereo frame.
Definition NRev.h:104
StkFrames & tick(StkFrames &iFrames, StkFrames &oFrames, unsigned int iChannel=0, unsigned int oChannel=0)
Take a channel of the iFrames object as inputs to the effect and write stereo outputs to the oFrames ...
An STK class to handle vectorized audio data.
Definition Stk.h:279
The STK namespace.
Definition ADSR.h:6