4 This module wraps the aubio library for Python using the numpy module.
6 Using the Python aubio module
7 -----------------------------
9 After installing python-aubio, you will be able to import the aubio module:
14 >>> help(aubio.miditofreq)
16 Finding some inspiration
17 ------------------------
19 Some examples are available in the `python/demos` directory. These scripts are
20 small programs written in python and using python-aubio.
22 For instance, `demo_source.py` reads a media file.
24 $ ./python/demos/demo_source.py /path/to/sound/sample.wav
26 and `demo_timestretch_online.py` stretches the original file into a new one:
28 $ ./python/demo/demo_timestretch_online.py loop.wav stretched_loop.wav 0.92`
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
35 Testing the Python module
36 -------------------------
38 Python tests are in `python/tests` and use [pytest].
40 To run the all the python tests:
45 Each test script can also be called one at a time. For instance:
47 $ pytest -v python/tests/test_note2midi.py
49 [pytest]: https://pytest.org
51 Install in a virtualenv
52 -----------------------
54 You should be able to install python-aubio directly from the top source
57 First, create a virtualenv to hold the required python module:
60 $ source pyaubio/bin/activate
62 Now install and build the python extension using:
69 Before compiling this module, you must have compiled libaubio.
71 A simple way to do this is with pip:
73 $ pip install -r requirements.txt
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).
79 Compiling python aubio
80 ----------------------
82 To build the aubio Python module, run the following command from the top source
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.
90 To find out more about `setup.py` options:
97 To install the Python module:
101 Alternatively, you may want to use the Python module without installing it by
102 setting your PYTHONPATH, for instance as follows:
104 $ export PYTHONPATH=$PYTHONPATH:$PWD/`ls -rtd build/lib.* | head -1`:$PWD/tests