Changeset 44582b0 for python


Ignore:
Timestamp:
Oct 29, 2018, 11:55:51 PM (5 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
Children:
1f07bdd
Parents:
4afeac2
Message:

[py] midi2note rounds to nearest integer midi note

File:
1 edited

Legend:

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

    r4afeac2 r44582b0  
    7373    " convert frequency in Hz to nearest note name, e.g. [0, 22050.] -> [C-1, G9] "
    7474    from aubio import freqtomidi
    75     return midi2note(int(freqtomidi(freq)))
     75    nearest_note = int(freqtomidi(freq) + .5)
     76    return midi2note(nearest_note)
Note: See TracChangeset for help on using the changeset viewer.