Changeset 6f944b5
- Timestamp:
- Oct 30, 2018, 12:22:41 AM (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:
- e9a4402
- Parents:
- 1f07bdd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/lib/aubio/midiconv.py
r1f07bdd r6f944b5 5 5 6 6 import sys 7 from ._aubio import freqtomidi 7 from ._aubio import freqtomidi, miditofreq 8 8 9 9 py3 = sys.version_info[0] == 3 … … 76 76 nearest_note = int(freqtomidi(freq) + .5) 77 77 return midi2note(nearest_note) 78 79 def note2freq(note): 80 """Convert note name to corresponding frequency, in Hz. 81 82 Parameters 83 ---------- 84 note : str 85 input note name 86 87 Returns 88 ------- 89 freq : float [0, 23000[ 90 frequency, in Hz 91 92 Example 93 ------- 94 >>> aubio.note2freq('A4') 95 440 96 >>> aubio.note2freq('A3') 97 220.1 98 """ 99 midi = note2midi(note) 100 return miditofreq(midi)
Note: See TracChangeset
for help on using the changeset viewer.