Changes in / [e893e6fe:bf3f09b]


Ignore:
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • .travis.yml

    re893e6fe rbf3f09b  
    6363    - sox
    6464    - lcov
    65   homebrew:
    66     packages:
    67     - sox
    68     - ffmpeg
    69     - libsndfile
    70     - lcov
    71     #update: true
    7265
    7366before_install:
    7467   - |
    7568     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
    7674       export PATH="$HOME/Library/Python/2.7/bin/:$PATH"
    7775     fi;
     
    8684  - which pip
    8785  - pip --version
     86  - pip install python-coveralls
     87  - gem install coveralls-lcov
    8888
    8989script:
     
    100100  - |
    101101    if [[ -z "$AUBIO_NOTESTS" ]]; then
     102      # upload lcov coverage to coveralls.io
     103      coveralls-lcov build/coverage.info
     104      # upload python coverage
     105      #coveralls
    102106      # upload to codecov
    103107      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.8
    6         * 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 for
    9         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, emit
    16         a warning if compiling against avutil < 53 (gh-137), wrap long lines
    17         * examples/: avoid hiding global and unreachable code
    18         * 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/win
    21         * mathutils: increase ln(2) precision of in freqtomidi/miditofreq
    22         * wavetable: stop sets playing to 0, add dummy implementation for _load
    23 
    24         [ New features ]
    25 
    26         * src/musicutils.h: new aubio_meltohz, aubio_hztomel, with _htk versions
    27         * src/spectral/filterbank.h: new set_mel_coeffs, set_mel_coeffs_htk,
    28         set_power, and set_norm methods, improved set_triangle_bands
    29         * src/spectral/mfcc.h: new set_scale, set_power, set_norm, set_mel_coeffs,
    30         set_mel_coeffs_htk, set_mel_coeffs_slaney
    31         * src/mathutils.h: new fvec_mul
    32         * 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 freq2note
    37         * general: supports code generation of setters with none or multiple
    38         parameters
    39         * documentation: add docstrings do fvec, cvec, source, sink, pvoc, frequency
    40         conversion and level detection routines (gh-73, debian #480018)
    41         * slicing: improve and document slice_source_at_stamps
    42         * module: new note2freq function, recover error log when raising exceptions
    43         on failed set_ methods, prevent cyclic import, coding style improvements
    44         * demos: improve coding style, fix bpm_extract arguments
    45         * MANIFEST.in: exclude *.pyc, improve patterns
    46 
    47         [ Documentation ]
    48 
    49         * doc/: use sphinx autodoc to load docstrings from aubio module, reorganize
    50         python module documentation, add a note about double precision, use https
    51         when possible
    52         * src/spectral/: update Auditory Toolbox url, update copyright year
    53 
    54         [ Tools ]
    55 
    56         * aubionotes: add --release-drop option
    57         * 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 slice
    60 
    61         [ Tests ]
    62 
    63         * tests/, python/tests: add tests for new methods, check source channel
    64         down-mix, improve coverage
    65 
    66         [ Build system ]
    67 
    68         * Makefile: disable docs when measuring coverage, add branch coverage
    69         option, add coverage_zero_counters target, improve html report
    70         * waf: update to 2.0.12, improve wscript style, prevent shipping some
    71         generated files
    72         * 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 improve
    75         configurations for appveyor, circleci, and travis.
    76 
    7712018-09-22 Paul Brossier <piem@aubio.org>
    782
  • MANIFEST.in

    re893e6fe rbf3f09b  
    22include python/README.md
    33include this_version.py
    4 include waf_gensyms.py
    54include waf
    65recursive-include waflib *.py
  • Makefile

    re893e6fe rbf3f09b  
    4343TESTSOUNDS := python/tests/sounds
    4444
    45 LCOVOPTS += --rc lcov_branch_coverage=1
    46 
    4745all: build
    4846
     
    246244coverage: force_uninstall_python deps_python \
    247245        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
    252247        pip install -v -e .
    253         # run tests, with python coverage
    254248        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
    264251
    265252# make sure we don't build the doc, which builds a temporary python module
    266253coverage_report: export WAFOPTS += --disable-docs
    267254coverage_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/.*"
    274260        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
    278262
    279263sphinx: configure
  • VERSION

    re893e6fe rbf3f09b  
    22AUBIO_MINOR_VERSION=4
    33AUBIO_PATCH_VERSION=8
    4 AUBIO_VERSION_STATUS=''
     4AUBIO_VERSION_STATUS='~alpha'
    55LIBAUBIO_LT_CUR=5
    6 LIBAUBIO_LT_REV=4
    7 LIBAUBIO_LT_AGE=8
     6LIBAUBIO_LT_REV=3
     7LIBAUBIO_LT_AGE=7
  • doc/aubiocut.txt

    re893e6fe rbf3f09b  
    5151  each slice (default 0).
    5252
    53   --create-first  Alway create first slice.
    54 
    5553  -h, --help  Print a short help message and exit.
    5654
  • doc/python_module.rst

    re893e6fe rbf3f09b  
    44===========================
    55
    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`_.
     6The aubio extension for Python is available for Python 2.7 and Python 3.
    147
    158Installing aubio with pip
    169-------------------------
    1710
    18 aubio can be installed from `PyPI`_ using ``pip``:
     11aubio can now be installed using ``pip``:
    1912
    2013.. code-block:: console
     
    2215    $ pip install aubio
    2316
    24 See also `Installing from PyPI`_ for general documentation.
     17Building the module
     18-------------------
    2519
    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:
     20From ``aubio`` source directory, run the following:
    4221
    4322.. code-block:: console
    4423
    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
    4727
    48 .. _Conda packages: https://anaconda.org/conda-forge/aubio
    49 .. _conda-forge: https://conda-forge.org/
    5028
    5129.. _py-doubleprecision:
     
    9068------------
    9169
    92 A number of Python tests are provided in the `python/tests`_ folder. To run
    93 them, install `pytest`_ and run it from the aubio source directory:
     70A number of python tests are provided. To run them, use [pytest] from the
     71aubio source tree:
    9472
    95 .. code-block:: console
    96 
    97     $ pip install pytest
    98     $ git clone https://git.aubio.org/aubio/aubio
    9973    $ cd aubio
    10074    $ pytest
    10175
    102 .. _python/tests: https://github.com/aubio/aubio/blob/master/python/tests
    103 .. _pytest: https://pytest.org
     76Each 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  
    303303................
    304304
    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 format
    307 <https://en.wikipedia.org/wiki/Single-precision_floating-point_format>`_
    308 (32-bit).  Some algorithms require a floating point representation with a
    309 higher precision, for instance to prevent arithmetic underflow in recursive
    310 filters.  In aubio, these special samples are named `lsmp_t` and defined as
    311 `double` by default (64-bit).
    312 
    313 Sometimes it may be useful to compile aubio in `double-precision`, for instance
    314 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- and
    318 double-precision modes:
    319 
    320 .. list-table:: Single and double-precision modes
    321    :align: center
    322 
    323    * -
    324      - single
    325      - double
    326    * - `smpl_t`
    327      - ``float``
    328      - ``double``
    329    * - `lsmp_t`
    330      - ``double``
    331      - ``long double``
    332 
    333305To compile aubio in double precision mode, configure with ``--enable-double``.
    334306
    335 To compile in single-precision mode (default), use ``--disable-double`` (or
    336 simply none of these two options).
     307To compile aubio in single precision mode, use ``--disable-double`` (default,
     308recommended).
    337309
    338310Disabling the tests
  • python/README.md

    re893e6fe rbf3f09b  
    1 aubio
    2 =====
     1Python aubio module
     2===================
    33
    4 aubio is a collection of tools for music and audio analysis.
     4This module wraps the aubio library for Python using the numpy module.
    55
    6 This package integrates the aubio library with [NumPy] to provide a set of
    7 efficient tools to process and analyse audio signals, including:
     6Using the Python aubio module
     7-----------------------------
    88
    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
     9After installing python-aubio, you will be able to import the aubio module:
    1510
    16 aubio works with both Python 2 and Python 3.
     11    $ python
     12    [...]
     13    >>> import aubio
     14    >>> help(aubio.miditofreq)
    1715
    18 Links
    19 -----
     16Finding some inspiration
     17------------------------
    2018
    21 - [module documentation][doc_python]
    22 - [installation instructions][doc_python_install]
    23 - [aubio manual][manual]
    24 - [aubio homepage][homepage]
    25 - [issue tracker][bugtracker]
     19Some examples are available in the `python/demos` directory. These scripts are
     20small programs written in python and using python-aubio.
    2621
    27 Demos
    28 -----
     22For instance, `demo_source.py` reads a media file.
    2923
    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
    3225
    33 **Notes**: installing additional modules is required to run some of the demos.
     26and `demo_timestretch_online.py` stretches the original file into a new one:
    3427
    35 ### Analysis
     28    $ ./python/demo/demo_timestretch_online.py loop.wav stretched_loop.wav 0.92`
    3629
    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.
     30Note: you might need to install additional modules to run some of the demos.
     31Some demos use [matplotlib](http://matplotlib.org/) to draw plots, others use
     32[PySoundCard](https://github.com/bastibe/PySoundCard) to play and record
     33sounds.
    4434
    45 ### Real-time
     35Testing the Python module
     36-------------------------
    4637
    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]
     38Python tests are in `python/tests` and use [pytest].
    5039
    51 ### Others
     40To run the all the python tests:
    5241
    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
    5744
    58 ### Example
     45Each test script can also be called one at a time. For instance:
    5946
    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
    6248
    63     $ python demo_timestretch_online.py loop.wav stretched_loop.wav 0.92
     49[pytest]: https://pytest.org
    6450
    65 Built with
     51Install in a virtualenv
     52-----------------------
     53
     54You should be able to install python-aubio directly from the top source
     55directory of aubio.
     56
     57First, create a virtualenv to hold the required python module:
     58
     59    $ virtualenv pyaubio
     60    $ source pyaubio/bin/activate
     61
     62Now install and build the python extension using:
     63
     64    $ pip install .
     65
     66Install requirements
     67--------------------
     68
     69Before compiling this module, you must have compiled libaubio.
     70
     71A simple way to do this is with pip:
     72
     73    $ pip install -r requirements.txt
     74
     75For more information about how this module works, please refer to the [Python/C
     76API 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
     79Compiling python aubio
     80----------------------
     81
     82To build the aubio Python module, run the following command from the top source
     83directory of aubio:
     84
     85    $ ./setup.py build
     86
     87Note: if libaubio was previously built using waf, the script will use it.
     88Otherwise, the entire library will be built inside the python extension.
     89
     90To find out more about `setup.py` options:
     91
     92    $ ./setup.py --help
     93
     94Installing
    6695----------
    6796
    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:
     97To install the Python module:
    7198
    72 - media file reading:
     99    $ ./setup.py install
    73100
    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.
     101Alternatively, you may want to use the Python module without installing it by
     102setting your PYTHONPATH, for instance as follows:
    78103
    79 - hardware acceleration:
     104    $ export PYTHONPATH=$PYTHONPATH:$PWD/`ls -rtd build/lib.* | head -1`:$PWD/tests
    80105
    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.org
    87 [avcodec]: https://libav.org
    88 [libsndfile]: http://www.mega-nerd.com/libsndfile/
    89 [libsamplerate]: http://www.mega-nerd.com/SRC/
    90 [CoreAudio]: https://developer.apple.com/reference/coreaudio
    91 [Atlas]: http://math-atlas.sourceforge.net/
    92 [Blas]: https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms
    93 [fftw3]: http://fftw.org
    94 [Accelerate]: https://developer.apple.com/reference/accelerate
    95 [Intel IPP]: https://software.intel.com/en-us/intel-ipp
    96 
    97 [demos_dir]:https://github.com/aubio/aubio/tree/master/python/demos
    98 [pyaudio]:https://people.csail.mit.edu/hubert/pyaudio/
    99 [PySoundCard]:https://github.com/bastibe/PySoundCard
    100 [pyalsaaudio]:https://larsimmisch.github.io/pyalsaaudio/
    101 [mido]:https://mido.readthedocs.io
    102 
    103 [manual]: https://aubio.org/manual/latest/
    104 [doc_python]: https://aubio.org/manual/latest/python.html
    105 [doc_python_install]: https://aubio.org/manual/latest/python_module.html
    106 [homepage]: https://aubio.org
    107 [NumPy]: https://www.numpy.org
    108 [bugtracker]: https://github.com/aubio/aubio/issues
    109 [matplotlib]:https://matplotlib.org/
  • python/tests/test_source_channels.py

    re893e6fe rbf3f09b  
    99import numpy as np
    1010from numpy.testing import assert_equal
    11 from .utils import get_tmp_sink_path
     11from utils import get_tmp_sink_path
    1212
    1313class aubio_source_test_case(unittest.TestCase):
  • setup.py

    re893e6fe rbf3f09b  
    6363    ]
    6464
    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 
    7065distrib = setup(name='aubio',
    7166    version = __version__,
     
    7469    ext_modules = [aubio_extension],
    7570    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',
    7872    license = 'GNU/GPL version 3',
    7973    author = 'Paul Brossier',
  • src/spectral/mfcc.h

    re893e6fe rbf3f09b  
    153153
    154154  \param mf mfcc object
     155  \param samplerate audio sampling rate, in Hz
    155156
    156157  The filter coefficients are built to match exactly Malcolm Slaney's Auditory
  • src/synth/wavetable.c

    re893e6fe rbf3f09b  
    168168}
    169169
    170 uint_t
    171 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 
    177170uint_t aubio_wavetable_set_freq ( aubio_wavetable_t * s, smpl_t freq )
    178171{
  • src/synth/wavetable.h

    re893e6fe rbf3f09b  
    5151*/
    5252aubio_wavetable_t * new_aubio_wavetable(uint_t samplerate, uint_t hop_size);
    53 
    54 /** load source in wavetable
    55 
    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 load
    60 
    61   \return 0 if successful, non-zero otherwise
    62 
    63 */
    64 uint_t aubio_wavetable_load( aubio_wavetable_t * o, const char_t * uri );
    6553
    6654/** process wavetable function
  • wscript

    re893e6fe rbf3f09b  
    619619    ctx.excl += ' **/python.old/*'
    620620    ctx.excl += ' **/python/*/*.old'
    621     ctx.excl += ' **/python/lib/aubio/*.so'
    622621    ctx.excl += ' **/python/tests/sounds'
    623622    ctx.excl += ' **/**.asc'
     
    629628    ctx.excl += ' **/.circleci/*'
    630629    ctx.excl += ' **/azure-pipelines.yml'
    631     ctx.excl += ' **/.coverage*'
     630    ctx.excl += ' **/.coveragerc'
Note: See TracChangeset for help on using the changeset viewer.