Bugfix in DelayL::setDelay(); Updated tick() functions in RtWvIn and InetWvIn to support channel offset

This commit is contained in:
Gary Scavone
2014-11-03 15:33:44 -05:00
parent 0a7c541cdc
commit 35f66c806e
8 changed files with 68 additions and 52 deletions

View File

@@ -52,30 +52,6 @@ void DelayL :: setMaximumDelay( unsigned long delay )
inputs_.resize(delay + 1, 1, 0.0);
}
void DelayL :: setDelay( StkFloat delay )
{
if ( delay + 1 > inputs_.size() ) { // The value is too big.
oStream_ << "DelayL::setDelay: argument (" << delay << ") greater than maximum!";
handleError( StkError::WARNING ); return;
}
if (delay < 0 ) {
oStream_ << "DelayL::setDelay: argument (" << delay << ") less than zero!";
handleError( StkError::WARNING ); return;
}
StkFloat outPointer = inPoint_ - delay; // read chases write
delay_ = delay;
while ( outPointer < 0 )
outPointer += inputs_.size(); // modulo maximum length
outPoint_ = (long) outPointer; // integer part
if ( outPoint_ == inputs_.size() ) outPoint_ = 0;
alpha_ = outPointer - outPoint_; // fractional part
omAlpha_ = (StkFloat) 1.0 - alpha_;
}
StkFloat DelayL :: tapOut( unsigned long tapDelay )
{
long tap = inPoint_ - tapDelay - 1;