mirror of
https://github.com/thestk/stk
synced 2026-01-14 13:31:53 +00:00
Bugfix in DelayL::setDelay(); Updated tick() functions in RtWvIn and InetWvIn to support channel offset
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user