Skip to content

Commit

Permalink
DelayWithInterpolation: sample operator now using interpolation class…
Browse files Browse the repository at this point in the history
…, passes tests. see issue #60
  • Loading branch information
nwolek committed Dec 26, 2015
1 parent 3a05941 commit 7a2365e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions include/objects/JamomaDelay.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,10 @@ namespace Jamoma {

const std::size_t mCapacity;
CircularSampleBufferGroup mHistory;
std::size_t mIntegralDelay;
double mFractionalDelay;
double mOneMinusFractionalDelay;
std::size_t mIntegralDelay;
double mFractionalDelay;
double mOneMinusFractionalDelay;
Jamoma::Interpolation::Linear<Jamoma::Sample> mInterpolation;

// NW: according to TAP this ensures that mHistory is resized when necessary
Observer mChannelCountObserver = { std::bind(&DelayWithLinearInterpolation::resizeHistory, this) };
Expand Down Expand Up @@ -166,8 +167,9 @@ namespace Jamoma {
{
mHistory[channel].resize(size+2); // need delay samples plus 2 "now" samples for interpolation
mHistory[channel].write(x);
return fractionalDelay() * mHistory[channel].tail() +
oneMinusFractionalDelay() * mHistory[channel].tail(1);
return mInterpolation(mHistory[channel].tail(1),
mHistory[channel].tail(),
fractionalDelay());
}

SharedSampleBundleGroup operator()(const SampleBundle& x)
Expand Down

0 comments on commit 7a2365e

Please sign in to comment.