Changeset 7f82f81
- Timestamp:
- Jul 22, 2016, 10:14:00 PM (8 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- f677688
- Parents:
- 655150ce
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/README.md
r655150ce r7f82f81 4 4 This module wraps the aubio library for Python using the numpy module. 5 5 6 Using the Python aubio module 7 ----------------------------- 8 9 After installing python-aubio, you will be able to import the aubio module: 10 11 $ python 12 [...] 13 >>> import aubio 14 >>> help(aubio.miditofreq) 15 16 Finding some inspiration 17 ------------------------ 18 19 Some examples are available in the `python/demos` directory. These scripts are 20 small programs written in python and using python-aubio. 21 22 For instance, `demo_source.py` reads a media file. 23 24 $ ./python/demos/demo_source.py /path/to/sound/sample.wav 25 26 and `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 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. 34 35 Testing the Python module 36 ------------------------- 37 38 To run the all the python tests, use the script: 39 40 $ ./python/tests/run_all_tests 41 42 Each test script can also be called one at a time. For instance: 43 44 $ ./python/tests/test_note2midi.py -v 45 46 Install in a virtualenv 47 ----------------------- 48 49 You should be able to install python-aubio directly from the top source 50 directory of aubio. 51 52 First, create a virtualenv to hold the required python module: 53 54 $ virtualenv pyaubio 55 $ source pyaubio/bin/activate 56 57 Now install and build the python extension using: 58 59 $ pip install . 60 61 Install requirements 62 -------------------- 63 6 64 Before compiling this module, you must have compiled libaubio. 65 66 A simple way to do this is with pip: 67 68 $ pip install -r requirements.txt 7 69 8 70 For more information about how this module works, please refer to the [Python/C … … 13 75 ---------------------- 14 76 15 After libaubio has been build successfully, and provided Python development 16 headers and numpy can be found on your system, you should be able to build the 17 aubio Python module: 77 To build the aubio Python module, run the following command from the top source 78 directory of aubio: 18 79 19 80 $ ./setup.py build 81 82 Note: if libaubio was previously built using waf, the script will use it. 83 Otherwise, the entire library will be built inside the python extension. 20 84 21 85 To find out more about `setup.py` options: … … 30 94 $ ./setup.py install 31 95 32 Using the Python module33 -----------------------34 35 Once the aubio library and the Python module are installed, you will be able to36 import the aubio module:37 38 $ python39 [...]40 >>> import aubio41 >>>42 43 96 Alternatively, you may want to use the Python module without installing it by 44 setting PYTHONPATH:97 setting your PYTHONPATH, for instance as follows: 45 98 46 99 $ export PYTHONPATH=$PYTHONPATH:$PWD/`ls -rtd build/lib.* | head -1`:$PWD/tests 47 100 48 Testing the Python module49 -------------------------50 51 Once both the C library and the Python module have been built correctly, and52 after you have installed them (or setting the environment variable correctly),53 you should be able to run the tests:54 55 $ ./tests/run_all_tests56 57 And to try out the demos:58 59 $ ./demos/demo_source.py /path/to/sound/sample.wav60 61 You need to install additional modules to run some of the demos. For62 instance, several demos use [matplotlib](http://matplotlib.org/) to draw plots.63 Some more demos use [PySoundCard](https://github.com/bastibe/PySoundCard) to64 play and record sounds.
Note: See TracChangeset
for help on using the changeset viewer.