Changeset 4120fbc for python/demos/demo_tempo_plot.py
- Timestamp:
- May 16, 2016, 3:16:00 AM (8 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:
- dc654f8
- Parents:
- 416ddd1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/demos/demo_tempo_plot.py
r416ddd1 r4120fbc 5 5 6 6 win_s = 512 # fft size 7 hop_s = win_s / 2# hop size7 hop_s = win_s // 2 # hop size 8 8 9 9 if len(sys.argv) < 2: 10 print "Usage: %s <filename> [samplerate]" % sys.argv[0]10 print("Usage: %s <filename> [samplerate]" % sys.argv[0]) 11 11 sys.exit(1) 12 12 … … 43 43 import matplotlib.pyplot as plt 44 44 bpms = 60./ diff(beats) 45 print 'mean period:', "%.2f" % mean(bpms), 'bpm', 'median', "%.2f" % median(bpms), 'bpm'46 print 'plotting', filename45 print('mean period: %.2fbpm, median: %.2fbpm' % (mean(bpms), median(bpms))) 46 print('plotting %s' % filename) 47 47 plt1 = plt.axes([0.1, 0.75, 0.8, 0.19]) 48 48 plt2 = plt.axes([0.1, 0.1, 0.8, 0.65], sharex = plt1) … … 76 76 77 77 else: 78 print 'mean period:', "%.2f" % 0, 'bpm', 'median', "%.2f" % 0, 'bpm',79 print 'nothing to plot, file too short?'78 print('mean period: %.2fbpm, median: %.2fbpm' % (0, 0)) 79 print('plotting %s' % filename)
Note: See TracChangeset
for help on using the changeset viewer.