* Add centre-focus option (mid/side processing)
* Simplify RingBuffer and add explicit memory locks * Fix hang with certain unfortunate combinations of parameters * Bump version to 1.7
This commit is contained in:
@@ -23,6 +23,23 @@
|
||||
namespace RubberBand
|
||||
{
|
||||
|
||||
/**
|
||||
* AudioCurveCalculator turns a sequence of audio "columns" --
|
||||
* short-time spectrum magnitude blocks -- into a sequence of numbers
|
||||
* representing some quality of the input such as power or likelihood
|
||||
* of an onset occurring.
|
||||
*
|
||||
* These are typically low-level building-blocks: AudioCurveCalculator
|
||||
* is a simple causal interface in which each input column corresponds
|
||||
* to exactly one output value which is returned immediately. They
|
||||
* have far less power (because of the causal interface and
|
||||
* magnitude-only input) and flexibility (because of the limited
|
||||
* return types) than for example the Vamp plugin interface.
|
||||
*
|
||||
* AudioCurveCalculator implementations typically remember the history
|
||||
* of their processing data, and the caller must call reset() before
|
||||
* resynchronising to an unrelated piece of input audio.
|
||||
*/
|
||||
class AudioCurveCalculator
|
||||
{
|
||||
public:
|
||||
@@ -56,11 +73,36 @@ public:
|
||||
// given instance
|
||||
|
||||
|
||||
/**
|
||||
* Process the given magnitude spectrum block and return the curve
|
||||
* value for it. The mag input contains (fftSize/2 + 1) values
|
||||
* corresponding to the magnitudes of the complex FFT output bins
|
||||
* for a windowed input of size fftSize. The hop (expressed in
|
||||
* time-domain audio samples) from the previous to the current
|
||||
* input block is given by increment.
|
||||
*/
|
||||
virtual float processFloat(const float *R__ mag, int increment) = 0;
|
||||
|
||||
/**
|
||||
* Process the given magnitude spectrum block and return the curve
|
||||
* value for it. The mag input contains (fftSize/2 + 1) values
|
||||
* corresponding to the magnitudes of the complex FFT output bins
|
||||
* for a windowed input of size fftSize. The hop (expressed in
|
||||
* time-domain audio samples) from the previous to the current
|
||||
* input block is given by increment.
|
||||
*/
|
||||
virtual double processDouble(const double *R__ mag, int increment) = 0;
|
||||
|
||||
/**
|
||||
* Reset the calculator, forgetting the history of the audio input
|
||||
* so far.
|
||||
*/
|
||||
virtual void reset() = 0;
|
||||
|
||||
/**
|
||||
* If the output of this calculator has a known unit, return it as
|
||||
* text. For example, "Hz" or "V".
|
||||
*/
|
||||
virtual const char *getUnit() const { return ""; }
|
||||
|
||||
protected:
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "system/VectorOps.h"
|
||||
#include "system/VectorOpsComplex.h"
|
||||
|
||||
#define FFT_MEASUREMENT 1
|
||||
//#define FFT_MEASUREMENT 1
|
||||
|
||||
|
||||
#ifdef HAVE_FFTW3
|
||||
|
||||
@@ -126,7 +126,7 @@ D_SRC::D_SRC(Resampler::Quality quality, int channels, int maxBufferSize,
|
||||
if (err) {
|
||||
std::cerr << "Resampler::Resampler: failed to create libsamplerate resampler: "
|
||||
<< src_strerror(err) << std::endl;
|
||||
throw Resampler::ImplementationError; //!!! of course, need to catch this!
|
||||
throw Resampler::ImplementationError;
|
||||
}
|
||||
|
||||
if (maxBufferSize > 0 && m_channels > 1) {
|
||||
@@ -184,7 +184,7 @@ D_SRC::resample(const float *const R__ *const R__ in,
|
||||
if (err) {
|
||||
std::cerr << "Resampler::process: libsamplerate error: "
|
||||
<< src_strerror(err) << std::endl;
|
||||
throw Resampler::ImplementationError; //!!! of course, need to catch this!
|
||||
throw Resampler::ImplementationError;
|
||||
}
|
||||
|
||||
if (m_channels > 1) {
|
||||
@@ -220,7 +220,7 @@ D_SRC::resampleInterleaved(const float *const R__ in,
|
||||
if (err) {
|
||||
std::cerr << "Resampler::process: libsamplerate error: "
|
||||
<< src_strerror(err) << std::endl;
|
||||
throw Resampler::ImplementationError; //!!! of course, need to catch this!
|
||||
throw Resampler::ImplementationError;
|
||||
}
|
||||
|
||||
m_lastRatio = ratio;
|
||||
|
||||
Reference in New Issue
Block a user