summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/ardour/ardour/audio_diskstream.h2
-rw-r--r--libs/ardour/ardour/interpolation.h4
-rw-r--r--libs/ardour/ardour/session.h2
-rw-r--r--libs/ardour/interpolation.cc12
4 files changed, 10 insertions, 10 deletions
diff --git a/libs/ardour/ardour/audio_diskstream.h b/libs/ardour/ardour/audio_diskstream.h
index ecced007cf..401ed9ec19 100644
--- a/libs/ardour/ardour/audio_diskstream.h
+++ b/libs/ardour/ardour/audio_diskstream.h
@@ -146,7 +146,7 @@ class AudioDiskstream : public Diskstream
}
}
- FixedPointLinearInterpolation interpolation;
+ LinearInterpolation interpolation;
XMLNode* deprecated_io_node;
diff --git a/libs/ardour/ardour/interpolation.h b/libs/ardour/ardour/interpolation.h
index e398171d2b..1ebdafefa2 100644
--- a/libs/ardour/ardour/interpolation.h
+++ b/libs/ardour/ardour/interpolation.h
@@ -13,9 +13,9 @@ class Interpolation {
double _speed, _target_speed;
public:
- Interpolation () { _speed = 1.0; }
+ Interpolation () { _speed = 1.0; _target_speed = 1.0; }
- void set_speed (double new_speed) { _speed = new_speed; }
+ void set_speed (double new_speed) { _speed = new_speed; _target_speed = new_speed; }
void set_target_speed (double new_speed) { _target_speed = new_speed; }
double target_speed() const { return _target_speed; }
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 7669883185..03112fb022 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -1016,7 +1016,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
volatile double _transport_speed;
double _last_transport_speed;
double _target_transport_speed;
- FixedPointLinearInterpolation interpolation;
+ LinearInterpolation interpolation;
bool auto_play_legal;
nframes_t _last_slave_transport_frame;
diff --git a/libs/ardour/interpolation.cc b/libs/ardour/interpolation.cc
index a1c7c67d2b..fbe0251471 100644
--- a/libs/ardour/interpolation.cc
+++ b/libs/ardour/interpolation.cc
@@ -34,7 +34,6 @@ FixedPointLinearInterpolation::interpolate (int channel, nframes_t nframes, Samp
if (input && output) {
// Linearly interpolate into the output buffer
- // using fixed point math
output[outsample] =
input[i] * (1.0f - fractional_phase_part) +
input[i+1] * fractional_phase_part;
@@ -85,10 +84,11 @@ LinearInterpolation::interpolate (int channel, nframes_t nframes, Sample *input,
acceleration = 0.0;
}
- printf("phase before: %lf\n", phase[channel]);
distance = phase[channel];
+ //printf("processing channel: %d\n", channel);
+ //printf("phase before: %lf\n", phase[channel]);
for (nframes_t outsample = 0; outsample < nframes; ++outsample) {
- i = distance;
+ i = floor(distance);
Sample fractional_phase_part = distance - i;
if (fractional_phase_part >= 1.0) {
fractional_phase_part -= 1.0;
@@ -107,11 +107,11 @@ LinearInterpolation::interpolate (int channel, nframes_t nframes, Sample *input,
//printf("distance after: %lf, _speed: %lf\n", distance, _speed);
}
- printf("before assignment: i: %d, distance: %lf\n", i, distance);
+ //printf("before assignment: i: %d, distance: %lf\n", i, distance);
i = floor(distance);
- printf("after assignment: i: %d, distance: %16lf\n", i, distance);
+ //printf("after assignment: i: %d, distance: %16lf\n", i, distance);
phase[channel] = distance - floor(distance);
- printf("speed: %16lf, i after: %d, distance after: %16lf, phase after: %16lf\n", _speed, i, distance, phase[channel]);
+ //printf("speed: %16lf, i after: %d, distance after: %16lf, phase after: %16lf\n", _speed, i, distance, phase[channel]);
return i;
}