Version 4.4.3

This commit is contained in:
Gary Scavone
2013-09-29 23:21:29 +02:00
committed by Stephen Sinclair
parent baca57040b
commit 0aec39260a
223 changed files with 26190 additions and 11130 deletions

View File

@@ -10,7 +10,7 @@
another allpass in series, followed by two allpass filters in
parallel with corresponding right and left outputs.
by Perry R. Cook and Gary P. Scavone, 1995 - 2010.
by Perry R. Cook and Gary P. Scavone, 1995-2011.
*/
/***************************************************/
@@ -21,6 +21,11 @@ namespace stk {
NRev :: NRev( StkFloat T60 )
{
if ( T60 <= 0.0 ) {
oStream_ << "NRev::NRev: argument (" << T60 << ") must be positive!";
handleError( StkError::FUNCTION_ARGUMENT );
}
lastFrame_.resize( 1, 2, 0.0 ); // resize lastFrame_ for stereo output
int lengths[15] = {1433, 1601, 1867, 2053, 2251, 2399, 347, 113, 37, 59, 53, 43, 37, 29, 19};
@@ -63,6 +68,11 @@ void NRev :: clear()
void NRev :: setT60( StkFloat T60 )
{
if ( T60 <= 0.0 ) {
oStream_ << "NRev::setT60: argument (" << T60 << ") must be positive!";
handleError( StkError::WARNING ); return;
}
for ( int i=0; i<6; i++ )
combCoefficient_[i] = pow(10.0, (-3.0 * combDelays_[i].getDelay() / (T60 * Stk::sampleRate())));
}
@@ -71,7 +81,7 @@ StkFrames& NRev :: tick( StkFrames& frames, unsigned int channel )
{
#if defined(_STK_DEBUG_)
if ( channel >= frames.channels() - 1 ) {
errorString_ << "NRev::tick(): channel and StkFrames arguments are incompatible!";
oStream_ << "NRev::tick(): channel and StkFrames arguments are incompatible!";
handleError( StkError::FUNCTION_ARGUMENT );
}
#endif
@@ -80,8 +90,7 @@ StkFrames& NRev :: tick( StkFrames& frames, unsigned int channel )
unsigned int hop = frames.channels();
for ( unsigned int i=0; i<frames.frames(); i++, samples += hop ) {
*samples = tick( *samples );
samples++;
*samples = lastFrame_[1];
*(samples+1) = lastFrame_[1];
}
return frames;
@@ -91,7 +100,7 @@ StkFrames& NRev :: tick( StkFrames& iFrames, StkFrames& oFrames, unsigned int iC
{
#if defined(_STK_DEBUG_)
if ( iChannel >= iFrames.channels() || oChannel >= oFrames.channels() - 1 ) {
errorString_ << "NRev::tick(): channel and StkFrames arguments are incompatible!";
oStream_ << "NRev::tick(): channel and StkFrames arguments are incompatible!";
handleError( StkError::FUNCTION_ARGUMENT );
}
#endif
@@ -100,8 +109,8 @@ StkFrames& NRev :: tick( StkFrames& iFrames, StkFrames& oFrames, unsigned int iC
StkFloat *oSamples = &oFrames[oChannel];
unsigned int iHop = iFrames.channels(), oHop = oFrames.channels();
for ( unsigned int i=0; i<iFrames.frames(); i++, iSamples += iHop, oSamples += oHop ) {
*oSamples++ = tick( *iSamples );
*oSamples = lastFrame_[1];
*oSamples = tick( *iSamples );
*(oSamples+1) = lastFrame_[1];
}
return iFrames;