* update from personal repo (including some significant fixes)
This commit is contained in:
@@ -104,6 +104,14 @@ RubberBandStretcher::Impl::ChannelData::construct(const std::set<size_t> &window
|
|||||||
for (size_t i = 0; i < initialWindowSize * oversample; ++i) {
|
for (size_t i = 0; i < initialWindowSize * oversample; ++i) {
|
||||||
dblbuf[i] = 0.0;
|
dblbuf[i] = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (size_t i = 0; i < maxSize; ++i) {
|
||||||
|
accumulator[i] = 0.f;
|
||||||
|
windowAccumulator[i] = 0.f;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Avoid dividing opening sample (which will be discarded anyway) by zero
|
||||||
|
windowAccumulator[0] = 1.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -934,9 +934,18 @@ RubberBandStretcher::Impl::calculateStretch()
|
|||||||
{
|
{
|
||||||
Profiler profiler("RubberBandStretcher::Impl::calculateStretch");
|
Profiler profiler("RubberBandStretcher::Impl::calculateStretch");
|
||||||
|
|
||||||
|
size_t inputDuration = m_inputDuration;
|
||||||
|
|
||||||
|
if (!m_realtime && m_expectedInputDuration > 0) {
|
||||||
|
if (m_expectedInputDuration != inputDuration) {
|
||||||
|
std::cerr << "RubberBandStretcher: WARNING: Actual study() duration differs from duration set by setExpectedInputDuration (" << m_inputDuration << " vs " << m_expectedInputDuration << ", diff = " << (m_expectedInputDuration - m_inputDuration) << "), using the latter for calculation" << std::endl;
|
||||||
|
inputDuration = m_expectedInputDuration;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<int> increments = m_stretchCalculator->calculate
|
std::vector<int> increments = m_stretchCalculator->calculate
|
||||||
(getEffectiveRatio(),
|
(getEffectiveRatio(),
|
||||||
m_inputDuration,
|
inputDuration,
|
||||||
m_phaseResetDf,
|
m_phaseResetDf,
|
||||||
m_stretchDf);
|
m_stretchDf);
|
||||||
|
|
||||||
|
|||||||
@@ -735,7 +735,7 @@ RubberBandStretcher::Impl::modifyChunk(size_t channel,
|
|||||||
bool inherit = false;
|
bool inherit = false;
|
||||||
|
|
||||||
if (laminar) {
|
if (laminar) {
|
||||||
if (distance >= mi) {
|
if (distance >= mi || i == count) {
|
||||||
inherit = false;
|
inherit = false;
|
||||||
} else if (bandlimited && (i == bandhigh || i == bandlow)) {
|
} else if (bandlimited && (i == bandhigh || i == bandlow)) {
|
||||||
inherit = false;
|
inherit = false;
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ float *allocFloat(float *ptr, int count)
|
|||||||
void *allocated;
|
void *allocated;
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
#ifndef __APPLE__
|
#ifndef __APPLE__
|
||||||
if (!posix_memalign(&allocated, 16, count * sizeof(float)))
|
if (posix_memalign(&allocated, 16, count * sizeof(float)))
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
allocated = malloc(count * sizeof(float));
|
allocated = malloc(count * sizeof(float));
|
||||||
@@ -134,7 +134,7 @@ double *allocDouble(double *ptr, int count)
|
|||||||
void *allocated;
|
void *allocated;
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
#ifndef __APPLE__
|
#ifndef __APPLE__
|
||||||
if (!posix_memalign(&allocated, 16, count * sizeof(double)))
|
if (posix_memalign(&allocated, 16, count * sizeof(double)))
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
allocated = malloc(count * sizeof(double));
|
allocated = malloc(count * sizeof(double));
|
||||||
|
|||||||
Reference in New Issue
Block a user