Changeset 3cc1491 for python


Ignore:
Timestamp:
Nov 13, 2013, 3:16:45 PM (11 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, 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.