feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5sampler
Last change
on this file since ce49bb5 was
c342c17,
checked in by Paul Brossier <piem@piem.org>, 12 years ago
|
python/demos/demo_miditofreq.py: added simple miditofreq example
|
-
Property mode set to
100755
|
File size:
331 bytes
|
Rev | Line | |
---|
[c342c17] | 1 | #! /usr/bin/env python |
---|
| 2 | |
---|
| 3 | from aubio import miditofreq |
---|
| 4 | from numpy import arange |
---|
| 5 | |
---|
| 6 | upsampling = 100. |
---|
| 7 | midi = arange(-10, 148 * upsampling) |
---|
| 8 | midi /= upsampling |
---|
| 9 | freq = miditofreq(midi) |
---|
| 10 | |
---|
| 11 | from matplotlib import pyplot as plt |
---|
| 12 | |
---|
| 13 | ax = plt.axes() |
---|
| 14 | ax.semilogy(midi, freq, '.') |
---|
| 15 | ax.set_xlabel('midi note') |
---|
| 16 | ax.set_ylabel('frequency (Hz)') |
---|
| 17 | plt.show() |
---|
Note: See
TracBrowser
for help on using the repository browser.