projects
/
aubio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
86ad546
)
python/demos/demo_miditofreq.py: added simple miditofreq example
author
Paul Brossier
<piem@piem.org>
Fri, 22 Mar 2013 17:35:26 +0000
(12:35 -0500)
committer
Paul Brossier
<piem@piem.org>
Fri, 22 Mar 2013 17:35:26 +0000
(12:35 -0500)
python/demos/demo_miditofreq.py
[new file with mode: 0755]
patch
|
blob
diff --git a/python/demos/demo_miditofreq.py
b/python/demos/demo_miditofreq.py
new file mode 100755
(executable)
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()