source: python/README.md @ dc1fbc6

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since dc1fbc6 was 7f82f81, checked in by Paul Brossier <piem@piem.org>, 8 years ago

python/README.md: update (closes #2)

  • Property mode set to 100644
File size: 2.6 KB
RevLine 
[f719589]1Python aubio module
2===================
3
[e794a80]4This module wraps the aubio library for Python using the numpy module.
[f719589]5
[7f82f81]6Using the Python aubio module
7-----------------------------
8
9After installing python-aubio, you will be able to import the aubio module:
10
11    $ python
12    [...]
13    >>> import aubio
14    >>> help(aubio.miditofreq)
15
16Finding some inspiration
17------------------------
18
19Some examples are available in the `python/demos` directory. These scripts are
20small programs written in python and using python-aubio.
21
22For instance, `demo_source.py` reads a media file.
23
24    $ ./python/demos/demo_source.py /path/to/sound/sample.wav
25
26and `demo_timestretch_online.py` stretches the original file into a new one:
27
28    $ ./python/demo/demo_timestretch_online.py loop.wav stretched_loop.wav 0.92`
29
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.
34
35Testing the Python module
36-------------------------
37
38To run the all the python tests, use the script:
39
40    $ ./python/tests/run_all_tests
41
42Each test script can also be called one at a time. For instance:
43
44    $ ./python/tests/test_note2midi.py -v
45
46Install in a virtualenv
47-----------------------
48
49You should be able to install python-aubio directly from the top source
50directory of aubio.
51
52First, create a virtualenv to hold the required python module:
53
54    $ virtualenv pyaubio
55    $ source pyaubio/bin/activate
56
57Now install and build the python extension using:
58
59    $ pip install .
60
61Install requirements
62--------------------
63
[e794a80]64Before compiling this module, you must have compiled libaubio.
65
[7f82f81]66A simple way to do this is with pip:
67
68    $ pip install -r requirements.txt
69
[e794a80]70For more information about how this module works, please refer to the [Python/C
71API Reference Manual] (http://docs.python.org/c-api/index.html) and the
72[Numpy/C API Reference](http://docs.scipy.org/doc/numpy/reference/c-api.html).
[f719589]73
[49505f7]74Compiling python aubio
75----------------------
[f719589]76
[7f82f81]77To build the aubio Python module, run the following command from the top source
78directory of aubio:
[e794a80]79
80    $ ./setup.py build
81
[7f82f81]82Note: if libaubio was previously built using waf, the script will use it.
83Otherwise, the entire library will be built inside the python extension.
84
[e794a80]85To find out more about `setup.py` options:
86
87    $ ./setup.py --help
88
89Installing
90----------
91
92To install the Python module:
[f719589]93
[e794a80]94    $ ./setup.py install
[c3d286c]95
[e794a80]96Alternatively, you may want to use the Python module without installing it by
[7f82f81]97setting your PYTHONPATH, for instance as follows:
[92c83ccc]98
99    $ export PYTHONPATH=$PYTHONPATH:$PWD/`ls -rtd build/lib.* | head -1`:$PWD/tests
100
Note: See TracBrowser for help on using the repository browser.