shithub: aubio

Download patch

ref: d1decd52d29b621d07bf45ed2b79dcb20ce414d1
parent: 7c9285f0daf07c4aa078d40c76568115ac8147a5
parent: 9c730b54548644bfaa9c7b780311baebc1d5940e
author: Paul Brossier <piem@piem.org>
date: Thu Jul 2 11:39:25 EDT 2020

Merge branch 'master' into feature/timestretch

--- a/.gitignore
+++ b/.gitignore
@@ -12,8 +12,8 @@
 RE:examples/[a-z]*
 
 # ignore compiled test programs
-RE:tests/src/test-[a-z-_]*$
-RE:tests/cpp/test-[a-z-_]*$
+RE:tests/src/test-[a-z_-]*$
+RE:tests/cpp/test-[a-z_-]*$
 
 # only sgml manpages count
 doc/*.1
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,18 +10,19 @@
       python: 3.6
       os: linux
       env: WAFOPTS="--build-type=debug"
-    - name: "Linux (Python 2.7)"
+    - name: "Linux (Python 2.7, nodeps)"
       python: 2.7
       os: linux
       distro: trusty
+      env: WAFOPTS="--nodeps"
     - name: "Linux (Python pypy3.5)"
       language: python
       python: "pypy3.5"
       os: linux
-    - name: "Linux (fftw3, no other deps)"
+    - name: "Linux (double, fftw3)"
       python: 3.8
       os: linux
-      env: HAVE_AUBIO_DOUBLE=1 CFLAGS="-O3" WAFOPTS="--enable-fftw3 --disable-avcodec --disable-sndfile --disable-samplerate --disable-rubberband"
+      env: HAVE_AUBIO_DOUBLE=1 CFLAGS="-O3" WAFOPTS="--enable-fftw3"
     - name: "Linux (default, dpkg-buildflags)"
       os: linux
       env: CFLAGS="`dpkg-buildflags --get CFLAGS`" LDFLAGS="`dpkg-buildflags --get LDFLAGS`"
@@ -40,15 +41,15 @@
       language: shell
       os: osx
       osx_image: xcode10
-      env: CFLAGS="-Os" HAVE_AUBIO_DOUBLE=1 WAFOPTS="--disable-accelerate --disable-avcodec --disable-sndfile --disable-samplerate --disable-rubberband"
+      env: CFLAGS="-Os" HAVE_AUBIO_DOUBLE=1 WAFOPTS="--disable-accelerate --nodeps"
     - name: "iOS"
       language: shell
       os: osx
-      env: WAFOPTS="--with-target-platform=ios --disable-avcodec --disable-sndfile --disable-samplerate --disable-rubberband" AUBIO_NOTESTS=1
+      env: WAFOPTS="--with-target-platform=ios --nodeps" AUBIO_NOTESTS=1
     - name: "iOSSimulator"
       language: shell
       os: osx
-      env: WAFOPTS="--with-target-platform=iosimulator --disable-avcodec --disable-sndfile --disable-samplerate --disable-rubberband" AUBIO_NOTESTS=1
+      env: WAFOPTS="--with-target-platform=iosimulator --nodeps" AUBIO_NOTESTS=1
 
 #    - name: "Windows (Python 3.8.0, lib only)"
 #      language: shell
--- a/Makefile
+++ b/Makefile
@@ -183,7 +183,7 @@
 	-$(SOX) -r 22050 -b 16 -n "$(TESTSOUNDS)/22050Hz_5s_brownnoise.wav"   synth 5    brownnoise      vol 0.9
 	-$(SOX) -r 32000 -b 16 -n "$(TESTSOUNDS)/32000Hz_127f_sine440.wav"    synth 127s sine 440        vol 0.9
 	-$(SOX) -r  8000 -b 16 -n "$(TESTSOUNDS)/8000Hz_30s_silence.wav"      trim 0 30
-	-$(SOX) -r 48000 -b 32 -n "$(TESTSOUNDS)/48000Hz_60s_sweep.wav"       synth 60   sine 100-20000  vol 0.9
+	-$(SOX) -r 48000 -b 16 -n "$(TESTSOUNDS)/48000Hz_60s_sweep.wav"       synth 60   sine 100-20000  vol 0.9
 	-$(SOX) -r 44100 -b 16 -n "$(TESTSOUNDS)/44100Hz_44100f_sine441.wav"  synth 44100s   sine 441 	vol 0.9
 	-$(SOX) -r 44100 -b 16 -n "$(TESTSOUNDS)/44100Hz_100f_sine441.wav"    synth 100s sine 441 	vol 0.9
 
--- a/doc/requirements.rst
+++ b/doc/requirements.rst
@@ -31,6 +31,8 @@
     If ``pkg-config`` is not found in ``PATH``, the configure step will
     succeed, but none of the external libraries will be used.
 
+To build aubio with no external libraries, use the ``--nodeps`` build option.
+
 Media libraries
 ---------------
 
--- a/python/demos/demo_pitch.py
+++ b/python/demos/demo_pitch.py
@@ -97,7 +97,7 @@
 # draw a line at tolerance
 ax3.plot(times, [tolerance]*len(confidences))
 ax3.axis( xmin = times[0], xmax = times[-1])
-ax3.set_ylabel('condidence')
+ax3.set_ylabel('confidence')
 set_xlabels_sample2time(ax3, times[-1], samplerate)
 plt.show()
 #plt.savefig(os.path.basename(filename) + '.svg')
--- a/src/musicutils.h
+++ b/src/musicutils.h
@@ -240,7 +240,7 @@
   \param v vector to get level from
   \param threshold threshold in dB SPL
 
-  \return 0 if level is under the given threshold, 1 otherwise
+  \return 1 if level is under the given threshold, 0 otherwise
 
 */
 uint_t aubio_silence_detection (const fvec_t * v, smpl_t threshold);
--- a/wscript
+++ b/wscript
@@ -48,6 +48,9 @@
     ctx.add_option('--debug', action = 'store_const',
             dest = 'build_type', const = 'debug',
             help = 'build in debug mode (see --build-type)')
+    ctx.add_option('--nodeps', action = 'store_const',
+            dest = 'nodeps', const = 'debug',
+            help = 'build with no external dependencies')
     add_option_enable_disable(ctx, 'fftw3f', default = False,
             help_str = 'compile with fftw3f instead of ooura (recommended)',
             help_disable_str = 'do not compile with fftw3f')
@@ -128,6 +131,27 @@
     target_platform = sys.platform
     if ctx.options.target_platform:
         target_platform = ctx.options.target_platform
+
+    if ctx.options.nodeps:
+        external_deps = [
+                'sndfile',
+                'samplerate',
+                'jack',
+                'avcodec',
+                'blas',
+                'fftw3',
+                'fftw3f',
+        ]
+        for d in external_deps:
+            if not hasattr(ctx.options, 'enable_' + d):
+                raise ctx.errors.ConfigurationError ('--enable-%s missing from options' % d)
+            if getattr(ctx.options, 'enable_' + d) == True:
+                msg = 'Option --nodeps can not be used along with --enable-%s' % d
+                raise ctx.errors.ConfigurationError (msg)
+            elif getattr(ctx.options, 'enable_' + d) is None:
+                msg = 'Option --nodeps used but automatic detection with --enable-%s' % d
+                ctx.msg('Warning', msg)
+            setattr(ctx.options, 'enable_' + d, False)
 
     from waflib import Options