- Timestamp:
- Oct 29, 2018, 11:57:00 PM (6 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master
- Children:
- 6f944b5, 7af37df
- Parents:
- 44582b0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/lib/aubio/midiconv.py
r44582b0 r1f07bdd 5 5 6 6 import sys 7 from ._aubio import freqtomidi 8 7 9 py3 = sys.version_info[0] == 3 8 10 if py3: … … 72 74 def freq2note(freq): 73 75 " convert frequency in Hz to nearest note name, e.g. [0, 22050.] -> [C-1, G9] " 74 from aubio import freqtomidi75 76 nearest_note = int(freqtomidi(freq) + .5) 76 77 return midi2note(nearest_note)
Note: See TracChangeset
for help on using the changeset viewer.