source: python/demos/demo_miditofreq.py @ 54eba9d

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5sampleryinfft+
Last change on this file since 54eba9d 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
Line 
1#! /usr/bin/env python
2
3from aubio import miditofreq
4from numpy import arange
5
6upsampling = 100.
7midi = arange(-10, 148 * upsampling)
8midi /= upsampling
9freq = miditofreq(midi)
10
11from matplotlib import pyplot as plt
12
13ax = plt.axes()
14ax.semilogy(midi, freq, '.')
15ax.set_xlabel('midi note')
16ax.set_ylabel('frequency (Hz)')
17plt.show()
Note: See TracBrowser for help on using the repository browser.