Ignore:
Timestamp:
Mar 10, 2017, 2:26:32 PM (7 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, sampler
Children:
ee8a57c
Parents:
00d0275 (diff), 67b6618 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into awhitening

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/demos/demo_tempo_plot.py

    r00d0275 r155cc10  
    55
    66win_s = 512                 # fft size
    7 hop_s = win_s / 2           # hop size
     7hop_s = win_s // 2          # hop size
    88
    99if len(sys.argv) < 2:
    10     print "Usage: %s <filename> [samplerate]" % sys.argv[0]
     10    print("Usage: %s <filename> [samplerate]" % sys.argv[0])
    1111    sys.exit(1)
    1212
     
    4040if len(beats) > 1:
    4141    # do plotting
    42     from numpy import array, arange, mean, median, diff
     42    from numpy import mean, median, diff
    4343    import matplotlib.pyplot as plt
    4444    bpms = 60./ diff(beats)
    45     print 'mean period:', "%.2f" % mean(bpms), 'bpm', 'median', "%.2f" % median(bpms), 'bpm'
    46     print 'plotting', filename
     45    print('mean period: %.2fbpm, median: %.2fbpm' % (mean(bpms), median(bpms)))
     46    print('plotting %s' % filename)
    4747    plt1 = plt.axes([0.1, 0.75, 0.8, 0.19])
    4848    plt2 = plt.axes([0.1, 0.1, 0.8, 0.65], sharex = plt1)
     
    7676
    7777else:
    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.