Changeset 3cc1491


Ignore:
Timestamp:
Nov 13, 2013, 3:16:45 PM (7 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
a6ad662
Parents:
6497e78
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/lib/aubio/midiconv.py

    r6497e78 r3cc1491  
    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
     50def freq2note(freq):
     51    from aubio import freqtomidi
     52    return midi2note(int(freqtomidi(freq)))
Note: See TracChangeset for help on using the changeset viewer.