Changeset 193dcbb for python/demos/demo_pitch.py
- Timestamp:
- May 26, 2015, 11:01:57 AM (9 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, pitchshift, sampler, timestretch, yinfft+
- Children:
- c82a034
- Parents:
- 9e54b83
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/demos/demo_pitch.py
r9e54b83 r193dcbb 23 23 24 24 pitch_o = pitch("yin", win_s, hop_s, samplerate) 25 pitch_o.set_unit(" freq")25 pitch_o.set_unit("midi") 26 26 pitch_o.set_tolerance(tolerance) 27 27 … … 37 37 confidence = pitch_o.get_confidence() 38 38 #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) 40 40 pitches += [pitch] 41 41 confidences += [confidence] … … 81 81 ax2.axis( ymin = 0.9 * true_freqs.min(), ymax = 1.1 * true_freqs.max() ) 82 82 # plot raw pitches 83 ax2.plot(times, pitches, ' --g')83 ax2.plot(times, pitches, '.g') 84 84 # plot cleaned up pitches 85 85 cleaned_pitches = pitches … … 91 91 #ax2.axis( ymin = 55, ymax = 70 ) 92 92 plt.setp(ax2.get_xticklabels(), visible = False) 93 ax2.set_ylabel('f0 ( Hz)')93 ax2.set_ylabel('f0 (midi)') 94 94 95 95 # plot confidence
Note: See TracChangeset
for help on using the changeset viewer.