Changes in / [e893e6fe:bf3f09b]
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
.travis.yml
re893e6fe rbf3f09b 63 63 - sox 64 64 - lcov 65 homebrew:66 packages:67 - sox68 - ffmpeg69 - libsndfile70 - lcov71 #update: true72 65 73 66 before_install: 74 67 - | 75 68 if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then 69 brew update 70 brew install sox 71 brew install ffmpeg 72 brew install libsndfile 73 brew install lcov 76 74 export PATH="$HOME/Library/Python/2.7/bin/:$PATH" 77 75 fi; … … 86 84 - which pip 87 85 - pip --version 86 - pip install python-coveralls 87 - gem install coveralls-lcov 88 88 89 89 script: … … 100 100 - | 101 101 if [[ -z "$AUBIO_NOTESTS" ]]; then 102 # upload lcov coverage to coveralls.io 103 coveralls-lcov build/coverage.info 104 # upload python coverage 105 #coveralls 102 106 # upload to codecov 103 107 bash <(curl -s https://codecov.io/bash) -
ChangeLog
re893e6fe rbf3f09b 1 2018-11-21 Paul Brossier <piem@aubio.org>2 3 [ Overview ]4 5 * VERSION: bump to 0.4.86 * notes: new option release_drop (gh-203)7 * spectral: new parameters added to filterbank and mfcc (gh-206)8 * python: start documenting module (gh-73, debian #480018), improve build for9 win-amd64 (gh-154, gh-199, gh-208)10 * fixes: prevent crash when using fft sizes unsupported by vDSP (gh-207),11 prevent saturation when down-mixing a multi-channel source (avcodec/ffmpeg)12 13 [ Fixes ]14 15 * avcodec: prevent saturation when down-mixing a multi-channel source, emit16 a warning if compiling against avutil < 53 (gh-137), wrap long lines17 * examples/: avoid hiding global and unreachable code18 * fft: limit to r*2*n sizes, with r in [1, 3, 5, 15] (vDSP only) (gh-207)19 * fft: fix reconstruction for odd sizes (fftw only)20 * pvoc: add missing implementations for aubio_pvoc_get_hop/win21 * mathutils: increase ln(2) precision of in freqtomidi/miditofreq22 * wavetable: stop sets playing to 0, add dummy implementation for _load23 24 [ New features ]25 26 * src/musicutils.h: new aubio_meltohz, aubio_hztomel, with _htk versions27 * src/spectral/filterbank.h: new set_mel_coeffs, set_mel_coeffs_htk,28 set_power, and set_norm methods, improved set_triangle_bands29 * src/spectral/mfcc.h: new set_scale, set_power, set_norm, set_mel_coeffs,30 set_mel_coeffs_htk, set_mel_coeffs_slaney31 * src/mathutils.h: new fvec_mul32 * src/notes: new option release_drop to prevent missing note-offs (gh-203)33 34 [ Python module ]35 36 * fix: rounding to nearest integer in midi2note and freq2note37 * general: supports code generation of setters with none or multiple38 parameters39 * documentation: add docstrings do fvec, cvec, source, sink, pvoc, frequency40 conversion and level detection routines (gh-73, debian #480018)41 * slicing: improve and document slice_source_at_stamps42 * module: new note2freq function, recover error log when raising exceptions43 on failed set_ methods, prevent cyclic import, coding style improvements44 * demos: improve coding style, fix bpm_extract arguments45 * MANIFEST.in: exclude *.pyc, improve patterns46 47 [ Documentation ]48 49 * doc/: use sphinx autodoc to load docstrings from aubio module, reorganize50 python module documentation, add a note about double precision, use https51 when possible52 * src/spectral/: update Auditory Toolbox url, update copyright year53 54 [ Tools ]55 56 * aubionotes: add --release-drop option57 * aubio: add --release-drop and --silence options to `aubio notes`,58 workaround for -V to really show version (py2)59 * aubiocut: add option --create-first to always create first slice60 61 [ Tests ]62 63 * tests/, python/tests: add tests for new methods, check source channel64 down-mix, improve coverage65 66 [ Build system ]67 68 * Makefile: disable docs when measuring coverage, add branch coverage69 option, add coverage_zero_counters target, improve html report70 * waf: update to 2.0.12, improve wscript style, prevent shipping some71 generated files72 * python: always show compiler warnings when pre-processing headers,73 workaround to fix code generation for win-amd64 (gh-154, gh-199, gh-208).74 * continuous integration: add azure pipelines, update and improve75 configurations for appveyor, circleci, and travis.76 77 1 2018-09-22 Paul Brossier <piem@aubio.org> 78 2 -
MANIFEST.in
re893e6fe rbf3f09b 2 2 include python/README.md 3 3 include this_version.py 4 include waf_gensyms.py5 4 include waf 6 5 recursive-include waflib *.py -
Makefile
re893e6fe rbf3f09b 43 43 TESTSOUNDS := python/tests/sounds 44 44 45 LCOVOPTS += --rc lcov_branch_coverage=146 47 45 all: build 48 46 … … 246 244 coverage: force_uninstall_python deps_python \ 247 245 clean_python clean distclean build local_dylib 248 # capture coverage after running c tests 249 lcov $(LCOVOPTS) --capture --no-external --directory . \ 250 --output-file build/coverage_lib.info 251 # build and test python 246 lcov --capture --no-external --directory . --output-file build/coverage_lib.info 252 247 pip install -v -e . 253 # run tests, with python coverage254 248 coverage run `which pytest` 255 # capture coverage again 256 lcov $(LCOVOPTS) --capture --no-external --directory . \ 257 --output-file build/coverage_python.info 258 # merge both coverage info files 259 lcov $(LCOVOPTS) -a build/coverage_python.info -a build/coverage_lib.info \ 260 --output-file build/coverage.info 261 # remove tests 262 lcov $(LCOVOPTS) --remove build/coverage.info '*/tests/*' '*/ooura_fft8g*' \ 263 --output-file build/coverage_lib.info 249 lcov --capture --no-external --directory . --output-file build/coverage_python.info 250 lcov -a build/coverage_python.info -a build/coverage_lib.info -o build/coverage.info 264 251 265 252 # make sure we don't build the doc, which builds a temporary python module 266 253 coverage_report: export WAFOPTS += --disable-docs 267 254 coverage_report: coverage 268 # create coverage report dir 269 mkdir -p build/coverage/ 270 # generate report with lcov's genhtml 271 genhtml build/coverage_lib.info --output-directory build/coverage/lcov \ 272 --branch-coverage --highlight --legend 273 # generate python report with coverage python package 255 genhtml build/coverage.info --output-directory lcov_html 256 mkdir -p gcovr_html/ 257 gcovr -r . --html --html-details \ 258 --output gcovr_html/index.html \ 259 --exclude ".*tests/.*" --exclude ".*examples/.*" 274 260 coverage report 275 coverage html -d build/coverage/coverage 276 # show links to generated reports 277 for i in $$(ls build/coverage/*/index.html); do echo file://$(PWD)/$$i; done 261 coverage html 278 262 279 263 sphinx: configure -
VERSION
re893e6fe rbf3f09b 2 2 AUBIO_MINOR_VERSION=4 3 3 AUBIO_PATCH_VERSION=8 4 AUBIO_VERSION_STATUS=' '4 AUBIO_VERSION_STATUS='~alpha' 5 5 LIBAUBIO_LT_CUR=5 6 LIBAUBIO_LT_REV= 47 LIBAUBIO_LT_AGE= 86 LIBAUBIO_LT_REV=3 7 LIBAUBIO_LT_AGE=7 -
doc/aubiocut.txt
re893e6fe rbf3f09b 51 51 each slice (default 0). 52 52 53 --create-first Alway create first slice.54 55 53 -h, --help Print a short help message and exit. 56 54 -
doc/python_module.rst
re893e6fe rbf3f09b 4 4 =========================== 5 5 6 aubio is available as a package for Python 2.7 and Python 3. The aubio 7 extension is written C using the `Python/C`_ and the `Numpy/C`_ APIs. 8 9 .. _Python/C: https://docs.python.org/c-api/index.html 10 .. _Numpy/C: https://docs.scipy.org/doc/numpy/reference/c-api.html 11 12 For general documentation on how to install Python packages, see `Installing 13 Packages`_. 6 The aubio extension for Python is available for Python 2.7 and Python 3. 14 7 15 8 Installing aubio with pip 16 9 ------------------------- 17 10 18 aubio can be installed from `PyPI`_using ``pip``:11 aubio can now be installed using ``pip``: 19 12 20 13 .. code-block:: console … … 22 15 $ pip install aubio 23 16 24 See also `Installing from PyPI`_ for general documentation. 17 Building the module 18 ------------------- 25 19 26 .. note:: 27 28 aubio is currently a `source only`_ package, so you will need a compiler to 29 install it from `PyPI`_. See also `Installing aubio with conda`_ for 30 pre-compiled binaries. 31 32 .. _PyPI: https://pypi.python.org/pypi/aubio 33 .. _Installing Packages: https://packaging.python.org/tutorials/installing-packages/ 34 .. _Installing from PyPI: https://packaging.python.org/tutorials/installing-packages/#installing-from-pypi 35 .. _source only: https://packaging.python.org/tutorials/installing-packages/#source-distributions-vs-wheels 36 37 Installing aubio with conda 38 --------------------------- 39 40 `Conda packages`_ are available through the `conda-forge`_ channel for Linux, 41 macOS, and Windows: 20 From ``aubio`` source directory, run the following: 42 21 43 22 .. code-block:: console 44 23 45 $ conda config --add channels conda-forge 46 $ conda install -c conda-forge aubio 24 $ ./setup.py clean 25 $ ./setup.py build 26 $ sudo ./setup.py install 47 27 48 .. _Conda packages: https://anaconda.org/conda-forge/aubio49 .. _conda-forge: https://conda-forge.org/50 28 51 29 .. _py-doubleprecision: … … 90 68 ------------ 91 69 92 A number of Python tests are provided in the `python/tests`_ folder. To run93 them, install `pytest`_ and run it from the aubio source directory:70 A number of python tests are provided. To run them, use [pytest] from the 71 aubio source tree: 94 72 95 .. code-block:: console96 97 $ pip install pytest98 $ git clone https://git.aubio.org/aubio/aubio99 73 $ cd aubio 100 74 $ pytest 101 75 102 .. _python/tests: https://github.com/aubio/aubio/blob/master/python/tests 103 .. _pytest: https://pytest.org 76 Each test script can also be called individually. For instance: 77 78 $ ./python/tests/test_note2midi.py -v 79 80 [pytest]: https://pytest.org -
doc/requirements.rst
re893e6fe rbf3f09b 303 303 ................ 304 304 305 The datatype used to store real numbers in aubio is named `smpl_t`. By default,306 `smpl_t` is defined as `float`, a `single-precision format307 <https://en.wikipedia.org/wiki/Single-precision_floating-point_format>`_308 (32-bit). Some algorithms require a floating point representation with a309 higher precision, for instance to prevent arithmetic underflow in recursive310 filters. In aubio, these special samples are named `lsmp_t` and defined as311 `double` by default (64-bit).312 313 Sometimes it may be useful to compile aubio in `double-precision`, for instance314 to reproduce numerical results obtained with 64-bit routines. In this case,315 `smpl_t` will be defined as `double`.316 317 The following table shows how `smpl_t` and `lsmp_t` are defined in single- and318 double-precision modes:319 320 .. list-table:: Single and double-precision modes321 :align: center322 323 * -324 - single325 - double326 * - `smpl_t`327 - ``float``328 - ``double``329 * - `lsmp_t`330 - ``double``331 - ``long double``332 333 305 To compile aubio in double precision mode, configure with ``--enable-double``. 334 306 335 To compile in single-precision mode (default), use ``--disable-double`` (or336 simply none of these two options).307 To compile aubio in single precision mode, use ``--disable-double`` (default, 308 recommended). 337 309 338 310 Disabling the tests -
python/README.md
re893e6fe rbf3f09b 1 aubio 2 ===== 1 Python aubio module 2 =================== 3 3 4 aubio is a collection of tools for music and audio analysis.4 This module wraps the aubio library for Python using the numpy module. 5 5 6 This package integrates the aubio library with [NumPy] to provide a set of 7 efficient tools to process and analyse audio signals, including: 6 Using the Python aubio module 7 ----------------------------- 8 8 9 - read audio from any media file, including videos and remote streams 10 - high quality phase vocoder, spectral filterbanks, and linear filters 11 - Mel-Frequency Cepstrum Coefficients and standard spectral descriptors 12 - detection of note attacks (onset) 13 - pitch tracking (fundamental frequency estimation) 14 - beat detection and tempo tracking 9 After installing python-aubio, you will be able to import the aubio module: 15 10 16 aubio works with both Python 2 and Python 3. 11 $ python 12 [...] 13 >>> import aubio 14 >>> help(aubio.miditofreq) 17 15 18 Links 19 ----- 16 Finding some inspiration 17 ------------------------ 20 18 21 - [module documentation][doc_python] 22 - [installation instructions][doc_python_install] 23 - [aubio manual][manual] 24 - [aubio homepage][homepage] 25 - [issue tracker][bugtracker] 19 Some examples are available in the `python/demos` directory. These scripts are 20 small programs written in python and using python-aubio. 26 21 27 Demos 28 ----- 22 For instance, `demo_source.py` reads a media file. 29 23 30 Some examples are available in the [`python/demos`][demos_dir] folder. Each 31 script is a command line program which accepts one ore more argument. 24 $ ./python/demos/demo_source.py /path/to/sound/sample.wav 32 25 33 **Notes**: installing additional modules is required to run some of the demos. 26 and `demo_timestretch_online.py` stretches the original file into a new one: 34 27 35 ### Analysis 28 $ ./python/demo/demo_timestretch_online.py loop.wav stretched_loop.wav 0.92` 36 29 37 - `demo_source.py` uses aubio to read audio samples from media files 38 - `demo_onset_plot.py` detects attacks in a sound file and plots the results 39 using [matplotlib] 40 - `demo_pitch.py` looks for fundamental frequency in a sound file and plots the 41 results using [matplotlib] 42 - `demo_spectrogram.py`, `demo_specdesc.py`, `demo_mfcc.py` for spectral 43 analysis. 30 Note: you might need to install additional modules to run some of the demos. 31 Some demos use [matplotlib](http://matplotlib.org/) to draw plots, others use 32 [PySoundCard](https://github.com/bastibe/PySoundCard) to play and record 33 sounds. 44 34 45 ### Real-time 35 Testing the Python module 36 ------------------------- 46 37 47 - `demo_pyaudio.py` and `demo_tapthebeat.py` use [pyaudio] 48 - `demo_pysoundcard_play.py`, `demo_pysoundcard.py` use [PySoundCard] 49 - `demo_alsa.py` uses [pyalsaaudio] 38 Python tests are in `python/tests` and use [pytest]. 50 39 51 ### Others 40 To run the all the python tests: 52 41 53 - `demo_timestretch.py` can change the duration of an input file and write the 54 new sound to disk, 55 - `demo_wav2midi.py` detects the notes in a file and uses [mido] to write the 56 results into a MIDI file 42 $ cd aubio 43 $ pytest 57 44 58 ### Example 45 Each test script can also be called one at a time. For instance: 59 46 60 Use `demo_timestretch_online.py` to slow down `loop.wav`, write the results in 61 `stretched_loop.wav`: 47 $ pytest -v python/tests/test_note2midi.py 62 48 63 $ python demo_timestretch_online.py loop.wav stretched_loop.wav 0.92 49 [pytest]: https://pytest.org 64 50 65 Built with 51 Install in a virtualenv 52 ----------------------- 53 54 You should be able to install python-aubio directly from the top source 55 directory of aubio. 56 57 First, create a virtualenv to hold the required python module: 58 59 $ virtualenv pyaubio 60 $ source pyaubio/bin/activate 61 62 Now install and build the python extension using: 63 64 $ pip install . 65 66 Install requirements 67 -------------------- 68 69 Before compiling this module, you must have compiled libaubio. 70 71 A simple way to do this is with pip: 72 73 $ pip install -r requirements.txt 74 75 For more information about how this module works, please refer to the [Python/C 76 API Reference Manual] (http://docs.python.org/c-api/index.html) and the 77 [Numpy/C API Reference](http://docs.scipy.org/doc/numpy/reference/c-api.html). 78 79 Compiling python aubio 80 ---------------------- 81 82 To build the aubio Python module, run the following command from the top source 83 directory of aubio: 84 85 $ ./setup.py build 86 87 Note: if libaubio was previously built using waf, the script will use it. 88 Otherwise, the entire library will be built inside the python extension. 89 90 To find out more about `setup.py` options: 91 92 $ ./setup.py --help 93 94 Installing 66 95 ---------- 67 96 68 The core of aubio is written in C for portability and speed. In addition to 69 [NumPy], aubio can be optionally built to use one or more of the following 70 libraries: 97 To install the Python module: 71 98 72 - media file reading: 99 $ ./setup.py install 73 100 74 - [ffmpeg] / [avcodec] to decode and read audio from almost any format, 75 - [libsndfile] to read audio from uncompressed sound files, 76 - [libsamplerate] to re-sample audio signals, 77 - [CoreAudio] to read all media formats supported by macOS, iOS, and tvOS. 101 Alternatively, you may want to use the Python module without installing it by 102 setting your PYTHONPATH, for instance as follows: 78 103 79 - hardware acceleration: 104 $ export PYTHONPATH=$PYTHONPATH:$PWD/`ls -rtd build/lib.* | head -1`:$PWD/tests 80 105 81 - [Atlas] and [Blas], for accelerated vector and matrix computations,82 - [fftw3], to compute fast Fourier Transforms of any size,83 - [Accelerate] for accelerated FFT and matrix computations (macOS/iOS),84 - [Intel IPP], accelerated vector computation and FFT implementation.85 86 [ffmpeg]: https://ffmpeg.org87 [avcodec]: https://libav.org88 [libsndfile]: http://www.mega-nerd.com/libsndfile/89 [libsamplerate]: http://www.mega-nerd.com/SRC/90 [CoreAudio]: https://developer.apple.com/reference/coreaudio91 [Atlas]: http://math-atlas.sourceforge.net/92 [Blas]: https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms93 [fftw3]: http://fftw.org94 [Accelerate]: https://developer.apple.com/reference/accelerate95 [Intel IPP]: https://software.intel.com/en-us/intel-ipp96 97 [demos_dir]:https://github.com/aubio/aubio/tree/master/python/demos98 [pyaudio]:https://people.csail.mit.edu/hubert/pyaudio/99 [PySoundCard]:https://github.com/bastibe/PySoundCard100 [pyalsaaudio]:https://larsimmisch.github.io/pyalsaaudio/101 [mido]:https://mido.readthedocs.io102 103 [manual]: https://aubio.org/manual/latest/104 [doc_python]: https://aubio.org/manual/latest/python.html105 [doc_python_install]: https://aubio.org/manual/latest/python_module.html106 [homepage]: https://aubio.org107 [NumPy]: https://www.numpy.org108 [bugtracker]: https://github.com/aubio/aubio/issues109 [matplotlib]:https://matplotlib.org/ -
python/tests/test_source_channels.py
re893e6fe rbf3f09b 9 9 import numpy as np 10 10 from numpy.testing import assert_equal 11 from .utils import get_tmp_sink_path11 from utils import get_tmp_sink_path 12 12 13 13 class aubio_source_test_case(unittest.TestCase): -
setup.py
re893e6fe rbf3f09b 63 63 ] 64 64 65 thisdir = os.path.abspath(os.path.dirname(__file__))66 py_readme_file = os.path.join(thisdir, 'python', 'README.md')67 with open(py_readme_file, 'r') as fp:68 long_description = ''.join(fp.readlines()[3:])69 70 65 distrib = setup(name='aubio', 71 66 version = __version__, … … 74 69 ext_modules = [aubio_extension], 75 70 description = 'a collection of tools for music analysis', 76 long_description = long_description, 77 long_description_content_type = 'text/markdown', 71 long_description = 'a collection of tools for music analysis', 78 72 license = 'GNU/GPL version 3', 79 73 author = 'Paul Brossier', -
src/spectral/mfcc.h
re893e6fe rbf3f09b 153 153 154 154 \param mf mfcc object 155 \param samplerate audio sampling rate, in Hz 155 156 156 157 The filter coefficients are built to match exactly Malcolm Slaney's Auditory -
src/synth/wavetable.c
re893e6fe rbf3f09b 168 168 } 169 169 170 uint_t171 aubio_wavetable_load ( aubio_wavetable_t *s UNUSED, const char_t *uri UNUSED)172 {173 AUBIO_ERR("wavetable: load method not implemented yet, see sampler\n");174 return AUBIO_FAIL;175 }176 177 170 uint_t aubio_wavetable_set_freq ( aubio_wavetable_t * s, smpl_t freq ) 178 171 { -
src/synth/wavetable.h
re893e6fe rbf3f09b 51 51 */ 52 52 aubio_wavetable_t * new_aubio_wavetable(uint_t samplerate, uint_t hop_size); 53 54 /** load source in wavetable55 56 TODO: This function is not implemented yet. See new_aubio_sampler() instead.57 58 \param o wavetable, created by new_aubio_wavetable()59 \param uri the uri of the source to load60 61 \return 0 if successful, non-zero otherwise62 63 */64 uint_t aubio_wavetable_load( aubio_wavetable_t * o, const char_t * uri );65 53 66 54 /** process wavetable function -
wscript
re893e6fe rbf3f09b 619 619 ctx.excl += ' **/python.old/*' 620 620 ctx.excl += ' **/python/*/*.old' 621 ctx.excl += ' **/python/lib/aubio/*.so'622 621 ctx.excl += ' **/python/tests/sounds' 623 622 ctx.excl += ' **/**.asc' … … 629 628 ctx.excl += ' **/.circleci/*' 630 629 ctx.excl += ' **/azure-pipelines.yml' 631 ctx.excl += ' **/.coverage *'630 ctx.excl += ' **/.coveragerc'
Note: See TracChangeset
for help on using the changeset viewer.