History

python/demos/demo_miditofreq.py: added simple miditofreq example

Paul Brossier committed 13 years ago

Commit c342c171 parent 86ad5461 file · +17 −0Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/demos/demo_miditofreq.py+17−0
@@ -0,0 +1,17 @@
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()

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t