Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SoundTouch 2.1.1 #1961

Merged
merged 7 commits into from
Dec 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ addons:
- librubberband-dev
- libshout3-dev
- libsndfile1-dev
- libsoundtouch-dev
- libsqlite3-dev
- libtag1-dev
- libupower-glib-dev
Expand All @@ -53,7 +54,7 @@ before_install:
# Virtual X, needed for analyzer waveform tests
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export DISPLAY=:99.0 ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sh -e /etc/init.d/xvfb start ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install scons portaudio libsndfile libogg libvorbis portmidi taglib libshout protobuf flac ffmpeg qt chromaprint rubberband libmodplug libid3tag libmad mp4v2 faad2 wavpack opusfile lilv lame; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install scons portaudio libsndfile libogg libvorbis portmidi taglib libshout protobuf flac ffmpeg qt chromaprint rubberband libmodplug libid3tag libmad mp4v2 faad2 wavpack opusfile lilv lame sound-touch; fi

install:
####
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ for:

install:
- sudo apt-get update
- sudo apt-get -y install gdb libavformat-dev libchromaprint-dev libfaad-dev libfftw3-dev libflac-dev libid3tag0-dev libmad0-dev libmodplug-dev libmp3lame-dev libmp4v2-dev libopusfile-dev libportmidi-dev libprotobuf-dev libqt5opengl5-dev libqt5sql5-sqlite libqt5svg5-dev librubberband-dev libshout3-dev libsndfile1-dev libsqlite3-dev libtag1-dev libupower-glib-dev libusb-1.0-0-dev libwavpack-dev portaudio19-dev protobuf-compiler qt5-default qtscript5-dev libqt5x11extras5-dev scons vamp-plugin-sdk qtkeychain-dev liblilv-dev
- sudo apt-get -y install gdb libavformat-dev libchromaprint-dev libfaad-dev libfftw3-dev libflac-dev libid3tag0-dev libmad0-dev libmodplug-dev libmp3lame-dev libmp4v2-dev libopusfile-dev libportmidi-dev libprotobuf-dev libqt5opengl5-dev libqt5sql5-sqlite libqt5svg5-dev librubberband-dev libshout3-dev libsndfile1-dev libsqlite3-dev libtag1-dev libupower-glib-dev libusb-1.0-0-dev libwavpack-dev portaudio19-dev protobuf-compiler qt5-default qtscript5-dev libqt5x11extras5-dev scons vamp-plugin-sdk qtkeychain-dev liblilv-dev libsoundtouch-dev

build_script:
- scons -j4 test=1 mad=1 faad=1 ffmpeg=1 opus=1 modplug=1 wv=1 hss1394=0 virtualize=0 debug_assertions_fatal=1 verbose=0 localecompare=1
Expand Down
Binary file removed lib/soundtouch-2.1.0.tar.bz2
Binary file not shown.
6 changes: 4 additions & 2 deletions lib/soundtouch/BPMDetect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,10 @@ BPMDetect::BPMDetect(int numChannels, int aSampleRate) :

// choose decimation factor so that result is approx. 1000 Hz
decimateBy = sampleRate / TARGET_SRATE;
assert(decimateBy > 0);
assert(INPUT_BLOCK_SIZE < decimateBy * DECIMATED_BLOCK_SIZE);
if ((decimateBy <= 0) || (decimateBy * DECIMATED_BLOCK_SIZE < INPUT_BLOCK_SIZE))
{
ST_THROW_RT_ERROR("Too small samplerate");
}

// Calculate window length & starting item according to desired min & max bpms
windowLen = (60 * sampleRate) / (decimateBy * MIN_BPM);
Expand Down
1,837 changes: 923 additions & 914 deletions lib/soundtouch/README.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/soundtouch/SoundTouch.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ namespace soundtouch
{

/// Soundtouch library version string
#define SOUNDTOUCH_VERSION "2.1"
#define SOUNDTOUCH_VERSION "2.1.1"

/// SoundTouch library version id
#define SOUNDTOUCH_VERSION_ID (20100)
#define SOUNDTOUCH_VERSION_ID (20101)

//
// Available setting IDs for the 'setSetting' & 'get_setting' functions:
Expand Down
2 changes: 2 additions & 0 deletions lib/soundtouch/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ same time

Visit [SoundTouch website](https://www.surina.net/soundtouch) and see the [README file](README.html) for more information and audio examples.

### The latest stable release is 2.1.1, tagged in git as 2.1.1

## Example

Use SoundStretch example app for modifying wav audio files, for example as follows:
Expand Down
22 changes: 18 additions & 4 deletions vamp-plugins/plugins/MixxxBpmDetection.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#include "MixxxBpmDetection.h"

#include <QString>
#include <QtDebug>

#include <stdexcept>

MixxxBpmDetection::MixxxBpmDetection(float inputSampleRate):
Vamp::Plugin(inputSampleRate),
m_pDetector(NULL),
Expand Down Expand Up @@ -175,7 +180,7 @@ std::string MixxxBpmDetection::getCurrentProgram() const {
return ""; // no programs
}

void MixxxBpmDetection::selectProgram(std::string name) {
void MixxxBpmDetection::selectProgram(std::string /*name*/) {
}

MixxxBpmDetection::OutputList MixxxBpmDetection::getOutputDescriptors() const {
Expand All @@ -198,11 +203,20 @@ MixxxBpmDetection::OutputList MixxxBpmDetection::getOutputDescriptors() const {
return list;
}

bool MixxxBpmDetection::initialise(size_t channels, size_t stepSize, size_t blockSize) {
bool MixxxBpmDetection::initialise(size_t channels, size_t /*stepSize*/, size_t blockSize) {
if (channels < getMinChannelCount() ||
channels > getMaxChannelCount()) return false;

m_pDetector = new soundtouch::BPMDetect(channels, m_iSampleRate);
try {
// Starting with SoundTouch 2.1.1 the constructor of
// BPMDetect may throw an exception.
m_pDetector = new soundtouch::BPMDetect(channels, m_iSampleRate);
} catch (const std::runtime_error& e) {
qWarning()
<< "Failed to initialize BPM detection:"
<< QString::fromStdString(e.what());
return false;
}
m_iBlockSize = blockSize;
return true;
}
Expand All @@ -212,7 +226,7 @@ void MixxxBpmDetection::reset() {
// Clear buffers, reset stored values, etc
}

MixxxBpmDetection::FeatureSet MixxxBpmDetection::process(const float *const *inputBuffers, Vamp::RealTime timestamp) {
MixxxBpmDetection::FeatureSet MixxxBpmDetection::process(const float *const *inputBuffers, Vamp::RealTime /*timestamp*/) {
if(m_pDetector != NULL) {
m_pDetector->inputSamples(inputBuffers[0], m_iBlockSize);
}
Expand Down
44 changes: 22 additions & 22 deletions vamp-plugins/plugins/MixxxBpmDetection.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,38 @@
#define _MIXXXBPMDETECTION_H_

#include <vamp-sdk/Plugin.h>
#include "BPMDetect.h"
#include <BPMDetect.h>

class MixxxBpmDetection : public Vamp::Plugin {
public:
MixxxBpmDetection(float inputSampleRate);
virtual ~MixxxBpmDetection();
~MixxxBpmDetection() override;

std::string getIdentifier() const;
std::string getName() const;
std::string getDescription() const;
std::string getMaker() const;
int getPluginVersion() const;
std::string getCopyright() const;
std::string getIdentifier() const override;
std::string getName() const override;
std::string getDescription() const override;
std::string getMaker() const override;
int getPluginVersion() const override;
std::string getCopyright() const override;

InputDomain getInputDomain() const;
size_t getPreferredBlockSize() const;
size_t getPreferredStepSize() const;
size_t getMinChannelCount() const;
size_t getMaxChannelCount() const;
InputDomain getInputDomain() const override;
size_t getPreferredBlockSize() const override;
size_t getPreferredStepSize() const override;
size_t getMinChannelCount() const override;
size_t getMaxChannelCount() const override;

ParameterList getParameterDescriptors() const;
float getParameter(std::string identifier) const;
void setParameter(std::string identifier, float value);
ParameterList getParameterDescriptors() const override;
float getParameter(std::string identifier) const override;
void setParameter(std::string identifier, float value) override;

ProgramList getPrograms() const;
std::string getCurrentProgram() const;
void selectProgram(std::string name);
ProgramList getPrograms() const override;
std::string getCurrentProgram() const override;
void selectProgram(std::string name) override;

OutputList getOutputDescriptors() const;
OutputList getOutputDescriptors() const override;

bool initialise(size_t channels, size_t stepSize, size_t blockSize);
void reset();
bool initialise(size_t channels, size_t stepSize, size_t blockSize) override;
void reset() override;

FeatureSet process(const float *const *inputBuffers,
Vamp::RealTime timestamp);
Expand Down