Ignore:
Timestamp:
Aug 10, 2006, 4:34:17 PM (18 years ago)
Author:
Paul Brossier <piem@altern.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:
e81c045
Parents:
33cf541
Message:

update demo-tempo to new gnuplot functions, fix audio yrange for -acf
update demo-tempo to new gnuplot functions, fix audio yrange for -acf

Location:
python/test/bench/tempo
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/test/bench/tempo/demo-tempo

    r33cf541 rdbd19ea  
    88from aubio.task import taskbeat,taskparams
    99from aubio.aubioclass import fvec, aubio_autocorr
    10 from aubio.gnuplot import gnuplot_create
     10from aubio.gnuplot import gnuplot_create, gnuplot_addargs
    1111from aubio.aubiowrapper import *
    1212from math import exp,log
     
    2323                          action="store", dest="printframe", default=-1,
    2424                          help="make a plot of the n_th frame")
    25         parser.add_option("-x","--xsize",
    26                           action="store", dest="xsize", default=1.,
    27                           type='float', help="define xsize for plot")
    28         parser.add_option("-y","--ysize",
    29                           action="store", dest="ysize", default=1.,
    30                           type='float', help="define ysize for plot")
    31         parser.add_option("-O","--outplot",
    32                           action="store", dest="outplot", default=None,
    33                           help="save plot to output.{ps,png}")
     25        gnuplot_addargs(parser)
    3426        (options, args) = parser.parse_args()
    3527        if not options.filename:
     
    5547  extension = ''
    5648  outplot = None
    57 f = gnuplot_create(outplot=outplot,extension=extension)
     49f = gnuplot_create(outplot=outplot,extension=extension,options=options)
    5850
    5951params = taskparams()
  • python/test/bench/tempo/demo-tempo-acf

    r33cf541 rdbd19ea  
    88from aubio.task import taskbeat,taskparams
    99from aubio.aubioclass import fvec, aubio_autocorr
    10 from aubio.gnuplot import gnuplot_create
     10from aubio.gnuplot import gnuplot_create, gnuplot_addargs
    1111from aubio.aubiowrapper import *
    1212from math import exp,log
     
    2323                          action="store", dest="printframe", default=-1,
    2424                          help="make a plot of the n_th frame")
    25         parser.add_option("-x","--xsize",
    26                           action="store", dest="xsize", default=1.,
    27                           type='float', help="define xsize for plot")
    28         parser.add_option("-y","--ysize",
    29                           action="store", dest="ysize", default=1.,
    30                           type='float', help="define ysize for plot")
    31         parser.add_option("-O","--outplot",
    32                           action="store", dest="outplot", default=None,
    33                           help="save plot to output.{ps,png}")
     25        gnuplot_addargs(parser)
    3426        (options, args) = parser.parse_args()
    3527        if not options.filename:
     
    5547  extension = ''
    5648  outplot = None
    57 f = gnuplot_create(outplot=outplot,extension=extension)
     49f = gnuplot_create(outplot,extension,options)
    5850
    5951params = taskparams()
     
    108100acf = fvec(winlen,1)
    109101
    110 if options.outplot and printframe > 0:
    111   extension = options.outplot.split('.')[-1]
    112   outplot = '.'.join(options.outplot.split('.')[:-1])
    113 else:
    114   extension = ''
    115   outplot = None
    116 f = gnuplot_create(outplot=outplot,extension=extension)
    117102nrframe = 0
    118103while (task.readsize == params.hopsize):
     
    150135      f('set orig %f,%f' % (0.0*xsize,0.66*ysize) )
    151136      f('set xrange [%f:%f]' % (0,btstep*hopsize) )
     137      f('set yrange [%f:%f]' % (-1.2*max(sig),1.2*max(sig)) )
    152138      f.title('Input signal')
    153139      f.xlabel('time (samples)')
     
    156142      f('set orig %f,%f' % (0.0*xsize,0.33*ysize) )
    157143      f('set xrange [%f:%f]' % (-winlen,0) )
     144      f('set autoscale y')
    158145      f.title('Onset detection function')
    159146      f.xlabel('time (df samples)')
Note: See TracChangeset for help on using the changeset viewer.