ref: 841ceede7d6094d043eb988ce8948bc2ef6d9475
parent: 11c46c8ef58f946086e295a21f2235c9eb88c125
parent: e3fde21dfc96db0c8998fae0f3999c6ab9a8a415
author: Paul Brossier <piem@piem.org>
date: Fri Jun 28 11:03:56 EDT 2019
Merge branch 'master' into fix/setbiquad
--- a/.travis.yml
+++ b/.travis.yml
@@ -38,15 +38,15 @@
- language: C
os: osx
compiler: clang
- env: WAFOPTS="--enable-fat --disable-avcodec --disable-sndfile"
+ env: WAFOPTS="--enable-fat --disable-avcodec --disable-sndfile --disable-samplerate"
- language: C
os: osx
compiler: clang
- env: WAFOPTS="--with-target-platform=ios --disable-avcodec --disable-sndfile" AUBIO_NOTESTS=1
+ env: WAFOPTS="--with-target-platform=ios --disable-avcodec --disable-sndfile --disable-samplerate" AUBIO_NOTESTS=1
- language: C
os: osx
compiler: clang
- env: WAFOPTS="--with-target-platform=iosimulator --disable-avcodec --disable-sndfile" AUBIO_NOTESTS=1
+ env: WAFOPTS="--with-target-platform=iosimulator --disable-avcodec --disable-sndfile --disable-samplerate" AUBIO_NOTESTS=1
# use trusty
dist: trusty
@@ -73,7 +73,7 @@
- ffmpeg
- libsndfile
- lcov
- #update: true
+ update: true
before_install:
- |
--- a/doc/binaries.rst
+++ b/doc/binaries.rst
@@ -8,5 +8,8 @@
and
`windows <https://aubio.org/download#win>`_
+For Windows, aubio is also available from `vcpkg
+<https://vcpkg.readthedocs.io/en/latest/examples/installing-and-using-packages/>`_.
+
To use aubio in a macOS or iOS application, see :ref:`xcode-frameworks-label`.
--- a/python/demos/demo_wav2midi.py
+++ b/python/demos/demo_wav2midi.py
@@ -63,7 +63,7 @@
delta = frames2tick(total_frames) - last_time
if new_note[2] > 0:
track.append(Message('note_off', note=int(new_note[2]),
- velocity=127, time=0)
+ velocity=127, time=delta)
)
track.append(Message('note_on',
note=int(new_note[0]),
--- a/python/ext/aubio-docstrings.h
+++ b/python/ext/aubio-docstrings.h
@@ -1,7 +1,7 @@
#define PYAUBIO_dct_doc \
"dct(size=1024)\n"\
"\n"\
- "Compute Discrete Fourier Transorms of Type-II.\n"\
+ "Compute Discrete Fourier Transforms of Type-II.\n"\
"\n"\
"Parameters\n"\
"----------\n"\
--- a/python/ext/py-fft.c
+++ b/python/ext/py-fft.c
@@ -3,7 +3,7 @@
static char Py_fft_doc[] = ""
"fft(size=1024)\n"
"\n"
-"Compute Fast Fourier Transorms.\n"
+"Compute Fast Fourier Transforms.\n"
"\n"
"Parameters\n"
"----------\n"
--- a/python/ext/py-sink.c
+++ b/python/ext/py-sink.c
@@ -81,7 +81,7 @@
"Close this sink now.\n"
"\n"
"By default, the sink will be closed before being deleted.\n"
-"Explicitely closing a sink can be useful to control the number\n"
+"Explicitly closing a sink can be useful to control the number\n"
"of files simultaneously opened.\n"
"";
--- a/python/lib/gen_external.py
+++ b/python/lib/gen_external.py
@@ -120,23 +120,24 @@
print("Running command: {:s}".format(" ".join(cpp_cmd)))
proc = subprocess.Popen(cpp_cmd,
stderr=subprocess.PIPE,
- stdout=subprocess.PIPE)
+ stdout=subprocess.PIPE,
+ universal_newlines=True)
assert proc, 'Proc was none'
cpp_output = proc.stdout.read()
err_output = proc.stderr.read()
if err_output:
print("Warning: preprocessor produced errors or warnings:\n%s" \
- % err_output.decode('utf8'))
+ % err_output)
if not cpp_output:
raise_msg = "preprocessor output is empty! Running command " \
+ "\"%s\" failed" % " ".join(cpp_cmd)
if err_output:
- raise_msg += " with stderr: \"%s\"" % err_output.decode('utf8')
+ raise_msg += " with stderr: \"%s\"" % err_output
else:
raise_msg += " with no stdout or stderr"
raise Exception(raise_msg)
if not isinstance(cpp_output, list):
- cpp_output = [l.strip() for l in cpp_output.decode('utf8').split('\n')]
+ cpp_output = [l.strip() for l in cpp_output.split('\n')]
return cpp_output
--- a/python/tests/test_hztomel.py
+++ b/python/tests/test_hztomel.py
@@ -4,6 +4,7 @@
from numpy.testing import TestCase
from numpy.testing import assert_equal, assert_almost_equal
from _tools import assert_warns
+from utils import is32bit
import numpy as np
import aubio
@@ -10,7 +11,6 @@
from aubio import hztomel, meltohz
from aubio import hztomel_htk, meltohz_htk
-
class aubio_hztomel_test_case(TestCase):
def test_hztomel(self):
@@ -17,10 +17,15 @@
assert_equal(hztomel(0.), 0.)
assert_almost_equal(hztomel(400. / 3.), 2., decimal=5)
assert_almost_equal(hztomel(1000. / 3), 5.)
- assert_equal(hztomel(200.), 3.)
+ # on 32bit, some of these tests fails unless compiling with -ffloat-store
+ try:
+ assert_equal(hztomel(200.), 3.)
+ except AssertionError:
+ if not is32bit(): raise
+ assert_almost_equal(hztomel(200.), 3., decimal=5)
assert_almost_equal(hztomel(1000.), 15)
- assert_almost_equal(hztomel(6400), 42)
- assert_almost_equal(hztomel(40960), 69)
+ assert_almost_equal(hztomel(6400), 42, decimal=5)
+ assert_almost_equal(hztomel(40960), 69, decimal=5)
for m in np.linspace(0, 1000, 100):
assert_almost_equal(hztomel(meltohz(m)) - m, 0, decimal=3)
@@ -28,7 +33,11 @@
def test_meltohz(self):
assert_equal(meltohz(0.), 0.)
assert_almost_equal(meltohz(2), 400. / 3., decimal=4)
- assert_equal(meltohz(3.), 200.)
+ try:
+ assert_equal(meltohz(3.), 200.)
+ except AssertionError:
+ if not is32bit(): raise
+ assert_almost_equal(meltohz(3.), 200., decimal=5)
assert_almost_equal(meltohz(5), 1000. / 3., decimal=4)
assert_almost_equal(meltohz(15), 1000., decimal=4)
assert_almost_equal(meltohz(42), 6400., decimal=2)
--- a/python/tests/test_phasevoc.py
+++ b/python/tests/test_phasevoc.py
@@ -1,7 +1,7 @@
#! /usr/bin/env python
from numpy.testing import TestCase, assert_equal, assert_array_less
-from _tools import parametrize
+from _tools import parametrize, skipTest
from aubio import fvec, cvec, pvoc, float_type
import numpy as np
@@ -51,7 +51,7 @@
assert_equal (s.phas[s.phas > 0], +np.pi)
assert_equal (s.phas[s.phas < 0], -np.pi)
assert_equal (np.abs(s.phas[np.abs(s.phas) != np.pi]), 0)
- self.skipTest('pvoc(fvec(%d)).phas != +0, ' % win_s \
+ skipTest('pvoc(fvec(%d)).phas != +0, ' % win_s \
+ 'This is expected when using fftw3 on powerpc.')
assert_equal ( r, 0.)
--- a/python/tests/utils.py
+++ b/python/tests/utils.py
@@ -3,10 +3,14 @@
import os
import re
import glob
+import struct
import numpy as np
from tempfile import mkstemp
DEFAULT_SOUND = '22050Hz_5s_brownnoise.wav'
+
+def is32bit():
+ return struct.calcsize("P") * 8 == 32
def array_from_text_file(filename, dtype = 'float'):
realpathname = os.path.join(os.path.dirname(__file__), filename)
--- a/scripts/get_waf.sh
+++ b/scripts/get_waf.sh
@@ -3,7 +3,7 @@
set -e
#set -x
-WAFVERSION=2.0.14
+WAFVERSION=2.0.17
WAFTARBALL=waf-$WAFVERSION.tar.bz2
WAFURL=https://waf.io/$WAFTARBALL
WAFUPSTREAMKEY=https://gitlab.com/ita1024/waf/raw/master/utils/pubkey.asc