source: python/demos/demo_miditofreq.py @ 49688ef

feature/crepe
Last change on this file since 49688ef 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
RevLine 
[c342c17]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.