diff --git a/.appveyor.yml b/.appveyor.yml index d8558dd..825ae67 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -16,6 +16,7 @@ build_script: - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" - meson build "-Dextra_include_dirs=C:\Program Files\libsndfile\include" "-Dextra_lib_dirs=C:\Program Files\libsndfile\lib" - ninja -C build - # And test the .NET FFI interface build, which is completely separate + # Test the VC++ static library build, which is separate + - msbuild otherbuilds\rubberband-library.vcxproj /t:Build /p:Configuration=Release + # And test the .NET FFI interface build, which is again separate - msbuild dotnet\rubberband.sln /t:Restore;Build - diff --git a/.hgtags b/.hgtags index 9259db4..3a82869 100644 --- a/.hgtags +++ b/.hgtags @@ -12,3 +12,4 @@ d4911a276d96f6232a68c6b8448056d3946043b9 v1.8.1 fa6a54be7e6bf0c5adffd19ccec622481a8140a5 v1.8.2 37b18c17c042eafc39483ffb58837de844ba3289 v1.9 7af7a76bbb1dc75f630555e22ca8f6ae9da79529 v1.9.1 +8584d22881ba41a97a9c79f6e091ff65b463970b v1.9.2 diff --git a/CHANGELOG b/CHANGELOG index 601f945..cccbb6d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,18 @@ +Changes in Rubber Band v1.9.2 + + * Introduce a built-in FFT option to be a good default when no + requirements point to a particular external library preference + * Fix potential crash following some reconfigure options. Thanks + to Michael Tyson for reporting this + * Ensure Accelerate is listed in generated pkg-config if required + * Check for existence of sincos in configuration + * Fix host identification when cross-compiling + +The API is unchanged and the library is binary compatible with +version 1.7. + + Changes in Rubber Band v1.9.1 * Switch build system from Makefiles and Visual Studio project to diff --git a/Doxyfile b/Doxyfile index 9bd8e0f..d3f3ab3 100644 --- a/Doxyfile +++ b/Doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = "Rubber Band Library" # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 1.9.1 +PROJECT_NUMBER = 1.9.2 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff --git a/README.md b/README.md index a993016..a1ccc21 100644 --- a/README.md +++ b/README.md @@ -161,8 +161,16 @@ acquired a commercial licence from the author. ## 4. Compiling the Rubber Band Library The primary supported build system for the Rubber Band Library on all -platforms is Meson (https://mesonbuild.com). To build, ensure Meson -and Ninja are installed and run: +platforms is Meson (https://mesonbuild.com). The Meson build system +can be used to build all targets (static and dynamic library, +command-line utility, and plugins) and to cross-compile. + +If you only need a static library and don't wish to use Meson, some +alternative build files (Makefiles and Visual C++ projects) are +included in the `otherbuilds` directory. See the platform-specific +build sections below for more details. + +To build with Meson, ensure Meson and Ninja are installed and run: ``` $ meson build && ninja -C build @@ -185,10 +193,6 @@ $ meson build -Dipp_path=/opt/intel/ipp The options are documented in the library- and platform-specific sections below. -For those who don't wish to use Meson, some alternative build files -(Makefiles and Visual C++ projects) are included in the `otherbuilds` -directory. These build only the static library. - The Rubber Band Library is written entirely in C++ to the C++98 standard. It is unlikely to make any difference (performance or otherwise) which C++ standard your compiler uses - as long as it's no @@ -304,10 +308,16 @@ commercial terms. ### 4d. Building on Windows -The default build on Windows also uses Meson, so ensure Meson and -Ninja are installed and available. Then, in a terminal window with the -compiler tools available in the path (e.g. a Visual Studio -command-line prompt for the relevant build architecture) run +If you only need to build the static library for integration into your +project, and you prefer a Visual Studio project file, you can find a +simple one in `otherbuilds\rubberband-library.vcxproj`. + +The rest of this section describes the "full" build system, which uses +Meson just as on the other platforms. So to build this way, start by +ensuring Meson and Ninja are installed and available. Then, in a +terminal window with the compiler tools available in the path (e.g. a +Visual Studio command-line prompt for the relevant build architecture) +run ``` > meson build @@ -329,10 +339,6 @@ option `b_vscrt`: See "FFT and resampler selection" below for further build options. -Alternatively, if you only need the static library and prefer a Visual -Studio project file, there is one targeted for VC 2015 in -`otherbuilds\rubberband-library.vcxproj`. - ### 4e. Building for Android and Java integration @@ -354,8 +360,8 @@ The supplied `.mk` file uses KissFFT and the Speex resampler. ### 4f. FFT and resampler selection -Rubber Band requires additional library code for FFT calculation and -resampling. Several libraries are supported. The selection is +Rubber Band requires the selection of library code for FFT calculation +and resampling. Several libraries are supported. The selection is controlled (in Meson) using `-D` options and (in the code itself) using preprocessor flags set by the build system. These options and flags are detailed in the tables below. @@ -364,13 +370,13 @@ At least one resampler implementation and one FFT implementation must be enabled. It is technically possible to enable more than one, but it's confusing and not often useful. -If you are building this software using one of the bundled library -options (Speex or KissFFT), please be sure to review the terms for -those libraries in `src/speex/COPYING` and `src/kissfft/COPYING` as -applicable. +If you are building this software using the bundled Speex or KissFFT +library code, please be sure to review the terms for those libraries +in `src/speex/COPYING` and `src/kissfft/COPYING` as applicable. -If you are proposing to package Rubber Band for a Linux distribution -using other packaged libraries, please select FFTW and libsamplerate. +If you are proposing to package Rubber Band for a Linux distribution, +please select either the built-in FFT (simpler for you) or FFTW (a bit +faster) and use libsamplerate. #### FFT libraries supported diff --git a/meson.build b/meson.build index 65d49eb..d82584b 100644 --- a/meson.build +++ b/meson.build @@ -2,7 +2,7 @@ project( 'Rubber Band Library', 'c', 'cpp', - version: '1.9.2-pre', + version: '1.9.2', license: 'GPL-2.0-or-later', default_options: [ # All Rubber Band code is actually C++98, but some compilers no @@ -15,7 +15,7 @@ project( meson_version: '>= 0.53.0' ) -rubberband_dynamic_library_version = '2.1.3' +rubberband_dynamic_library_version = '2.1.4' system = host_machine.system() architecture = host_machine.cpu_family() @@ -341,18 +341,18 @@ if system == 'darwin' endforeach if architecture == 'aarch64' - mac_platform_arguments = [ + arch_flags += [ '-arch', 'arm64', ] if not have_version_min - mac_platform_arguments += [ '-mmacosx-version-min=11' ] + arch_flags += [ '-mmacosx-version-min=11' ] endif elif architecture == 'x86_64' - mac_platform_arguments = [ + arch_flags += [ '-arch', 'x86_64', ] if not have_version_min - mac_platform_arguments += [ '-mmacosx-version-min=10.13' ] + arch_flags += [ '-mmacosx-version-min=10.13' ] endif else # begin architecture != 'aarch64' or 'x86_64' error('Build for architecture ' + architecture + ' is not supported on this platform') diff --git a/otherbuilds/deploy/macos.sh b/otherbuilds/deploy/macos.sh index 425b5eb..e27352a 100755 --- a/otherbuilds/deploy/macos.sh +++ b/otherbuilds/deploy/macos.sh @@ -1,19 +1,40 @@ #!/bin/bash set -eu if [ ! -f ../rba/deploy/macos/notarize.sh ]; then - echo "need notarize script in ../rba/deploy/macos" + echo "Need notarize script in ../rba/deploy/macos" fi + version=$(grep '^ *version:' meson.build | head -1 | sed "s/^.*'\([0-9][0-9.]*\)'.*$/\1/") echo echo "Packaging command-line utility for Mac for Rubber Band v$version..." echo -rm -rf build -PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ meson build --cross-file ./cross/macos-universal.txt -ninja -C build -./build/rubberband -V +if [ -f /usr/local/lib/libsndfile.dylib ]; then + echo "(WARNING: libsndfile dynamic library found in /usr/local/lib!" + echo "Be sure that you aren't about to combine this external dependency" + echo "with the hardened runtime)" +fi + +echo -n "Proceed [Yn] ? " +read yn +case "$yn" in "") ;; [Yy]) ;; *) exit 3;; esac +echo "Proceeding" + +rm -rf build_arm64 build_x86_64 tmp_pack +PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ meson build_arm64 --cross-file ./cross/macos-arm64.txt +PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ meson build_x86_64 --cross-file ./cross/macos-x86_64.txt +ninja -C build_arm64 +ninja -C build_x86_64 +mkdir tmp_pack +lipo build_arm64/rubberband build_x86_64/rubberband -create -output tmp_pack/rubberband + +echo +echo "Check the following version number: it should read $version" +tmp_pack/rubberband -V +echo + key="Developer ID Application: Particular Programs Ltd (73F996B92S)" mkdir -p packages -( cd build +( cd tmp_pack codesign -s "$key" -fv --options runtime rubberband zipfile="rubberband-$version-gpl-executable-macos.zip" rm -f "$zipfile" @@ -23,7 +44,7 @@ mkdir -p packages package_dir="rubberband-$version-gpl-executable-macos" rm -rf "$package_dir" mkdir "$package_dir" -cp build/rubberband "$package_dir" +cp tmp_pack/rubberband "$package_dir" cp CHANGELOG README.md COPYING "$package_dir" tar cvjf "$package_dir.tar.bz2" "$package_dir" mv "$package_dir.tar.bz2" packages/ diff --git a/rubberband/RubberBandStretcher.h b/rubberband/RubberBandStretcher.h index 0d88583..64ab048 100644 --- a/rubberband/RubberBandStretcher.h +++ b/rubberband/RubberBandStretcher.h @@ -24,7 +24,7 @@ #ifndef RUBBERBAND_STRETCHER_H #define RUBBERBAND_STRETCHER_H -#define RUBBERBAND_VERSION "1.9.1" +#define RUBBERBAND_VERSION "1.9.2" #define RUBBERBAND_API_MAJOR_VERSION 2 #define RUBBERBAND_API_MINOR_VERSION 6 diff --git a/rubberband/rubberband-c.h b/rubberband/rubberband-c.h index c77d59f..887ddf3 100644 --- a/rubberband/rubberband-c.h +++ b/rubberband/rubberband-c.h @@ -28,7 +28,7 @@ extern "C" { #endif -#define RUBBERBAND_VERSION "1.9.1" +#define RUBBERBAND_VERSION "1.9.2" #define RUBBERBAND_API_MAJOR_VERSION 2 #define RUBBERBAND_API_MINOR_VERSION 6 diff --git a/src/StretcherImpl.cpp b/src/StretcherImpl.cpp index 0794156..2d428bb 100644 --- a/src/StretcherImpl.cpp +++ b/src/StretcherImpl.cpp @@ -853,6 +853,10 @@ RubberBandStretcher::Impl::reconfigure() if (m_fftSize != prevFftSize) { m_phaseResetAudioCurve->setFftSize(m_fftSize); + m_silentAudioCurve->setFftSize(m_fftSize); + if (m_stretchAudioCurve) { + m_stretchAudioCurve->setFftSize(m_fftSize); + } somethingChanged = true; } diff --git a/src/dsp/FFT.cpp b/src/dsp/FFT.cpp index ca2fec0..5bfc3f7 100644 --- a/src/dsp/FFT.cpp +++ b/src/dsp/FFT.cpp @@ -701,6 +701,7 @@ public: if (!m_dspec) initDouble(); double *d[2] = { m_dpacked->realp, m_dpacked->imagp }; v_deinterleave(d, complexIn, 2, m_size/2 + 1); + dnyq(); vDSP_fft_zriptD(m_dspec, m_dpacked, 1, m_dbuf, m_order, FFT_INVERSE); unpackReal(realOut); } @@ -738,6 +739,7 @@ public: if (!m_fspec) initFloat(); float *f[2] = { m_fpacked->realp, m_fpacked->imagp }; v_deinterleave(f, complexIn, 2, m_size/2 + 1); + fnyq(); vDSP_fft_zript(m_fspec, m_fpacked, 1, m_fbuf, m_order, FFT_INVERSE); unpackReal(realOut); }