Changeset 193dcbb for python


Ignore:
Timestamp:
May 26, 2015, 11:01:57 AM (10 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:
c82a034
Parents:
9e54b83
Message:

python/demos/demo_pitch.py: remove stdout, plot in midi

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/demos/demo_pitch.py

    r9e54b83 r193dcbb  
    2323
    2424pitch_o = pitch("yin", win_s, hop_s, samplerate)
    25 pitch_o.set_unit("freq")
     25pitch_o.set_unit("midi")
    2626pitch_o.set_tolerance(tolerance)
    2727
     
    3737    confidence = pitch_o.get_confidence()
    3838    #if confidence < 0.8: pitch = 0.
    39     print "%f %f %f" % (total_frames / float(samplerate), pitch, confidence)
     39    #print "%f %f %f" % (total_frames / float(samplerate), pitch, confidence)
    4040    pitches += [pitch]
    4141    confidences += [confidence]
     
    8181    ax2.axis( ymin = 0.9 * true_freqs.min(), ymax = 1.1 * true_freqs.max() )
    8282# plot raw pitches
    83 ax2.plot(times, pitches, '--g')
     83ax2.plot(times, pitches, '.g')
    8484# plot cleaned up pitches
    8585cleaned_pitches = pitches
     
    9191#ax2.axis( ymin = 55, ymax = 70 )
    9292plt.setp(ax2.get_xticklabels(), visible = False)
    93 ax2.set_ylabel('f0 (Hz)')
     93ax2.set_ylabel('f0 (midi)')
    9494
    9595# plot confidence
Note: See TracChangeset for help on using the changeset viewer.