Showing the changes to python (1 of 1 file). Show all
Unified · Split
| @@ -57,21 +57,47 @@ Documentation · 56 unmodified lines | |||
| 57 | [homepage]: https://aubio.org | 57 | [homepage]: https://aubio.org |
| 58 | [NumPy]: https://www.numpy.org | 58 | [NumPy]: https://www.numpy.org |
| 59 | 59 | ||
| 60 | Finding some inspiration | 60 | Demos scripts |
| 61 | ------------------------ | 61 | ------------- |
| 62 | |||
| 63 | Some examples are available in the [`python/demos`][demos_dir] folder. These | ||
| 64 | scripts are small programs written in python and using python-aubio. | ||
| 65 | |||
| 66 | **Notes**: installing additional modules is required to run some of the demos. | ||
| 67 | |||
| 68 | ### Analysis | ||
| 69 | |||
| 70 | - `demo_source.py` uses aubio to read audio samples from media files | ||
| 71 | - `demo_onset_plot.py` detects attacks in a sound file and plots the results | ||
| 72 | using [matplotlib] | ||
| 73 | - `demo_pitch.py` looks for fundamental frequency in a sound file and plots the | ||
| 74 | results using [matplotlib] | ||
| 75 | - `demo_spectrogram.py`, `demo_specdesc.py`, `demo_mfcc.py` for spectral | ||
| 76 | analysis. | ||
| 77 | |||
| 78 | ### Real-time | ||
| 79 | |||
| 80 | - `demo_pyaudio.py` and `demo_tapthebeat.py` use [pyaudio] | ||
| 81 | - `demo_pysoundcard_play.py`, `demo_pysoundcard.py` use [PySoundCard] | ||
| 82 | - `demo_alsa.py` uses [pyalsaaudio] | ||
| 62 | 83 | ||
| 63 | Some examples are available in the `python/demos` directory. These scripts are | 84 | ### Others |
| 64 | small programs written in python and using python-aubio. | ||
| 65 | 85 | ||
| 66 | For instance, `demo_source.py` reads a media file. | 86 | - `demo_timestretch.py` can change the duration of an input file and write the |
| 87 | new sound to disk, | ||
| 88 | - `demo_wav2midi.py` detects the notes in a file and uses [mido] to write the | ||
| 89 | results into a MIDI file | ||
| 67 | 90 | ||
| 68 | $ ./python/demos/demo_source.py /path/to/sound/sample.wav | 91 | ### Example |
| 69 | 92 | ||
| 70 | and `demo_timestretch_online.py` stretches the original file into a new one: | 93 | Use `demo_timestretch_online.py` to slow down `loop.wav`, write the results in |
| 94 | `stretched_loop.wav`: | ||
| 71 | 95 | ||
| 72 | $ ./python/demo/demo_timestretch_online.py loop.wav stretched_loop.wav 0.92` | 96 | $ python demo_timestretch_online.py loop.wav stretched_loop.wav 0.92 |
| 73 | 97 | ||
| 74 | Note: you might need to install additional modules to run some of the demos. | 98 | [demos_dir]:https://github.com/aubio/aubio/tree/master/python/demos |
| 75 | Some demos use [matplotlib](http://matplotlib.org/) to draw plots, others use | 99 | [pyaudio]:https://people.csail.mit.edu/hubert/pyaudio/ |
| 76 | [PySoundCard](https://github.com/bastibe/PySoundCard) to play and record | 100 | [PySoundCard]:https://github.com/bastibe/PySoundCard |
| 77 | sounds. | 101 | [pyalsaaudio]:https://larsimmisch.github.io/pyalsaaudio/ |
| 102 | [mido]:https://mido.readthedocs.io | ||
| 103 | [matplotlib]:https://matplotlib.org/ | ||