History

python/lib/aubio/midiconv.py: add freq2note

Paul Brossier committed 13 years ago

Commit 3cc14911 parent 6497e781 file · +4 −0Browse files

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

Unified · Split

python/lib/aubio/midiconv.py+4−0
@@ -46,3 +46,7 @@ def midi2note(midi): · 45 unmodified lines
4646 midi = int(midi)
4747 _valid_notenames = ['C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'B']
4848 return _valid_notenames[midi % 12] + str( midi / 12 - 1)
49+
50+def freq2note(freq):
51+ from aubio import freqtomidi
52+ return midi2note(int(freqtomidi(freq)))

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