diff options
Diffstat (limited to 'python/demos/demo_miditofreq.py')
-rwxr-xr-x | python/demos/demo_miditofreq.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/python/demos/demo_miditofreq.py b/python/demos/demo_miditofreq.py new file mode 100755 index 0000000..c325fb5 --- /dev/null +++ b/python/demos/demo_miditofreq.py @@ -0,0 +1,17 @@ +#! /usr/bin/env python + +from aubio import miditofreq +from numpy import arange + +upsampling = 100. +midi = arange(-10, 148 * upsampling) +midi /= upsampling +freq = miditofreq(midi) + +from matplotlib import pyplot as plt + +ax = plt.axes() +ax.semilogy(midi, freq, '.') +ax.set_xlabel('midi note') +ax.set_ylabel('frequency (Hz)') +plt.show() |