From 742c9b839f9f952986011be98fc95fcd4a4b9f54 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 28 Jul 2006 13:08:51 +0000 Subject: [PATCH] add bench-pitch-plot-isolated add bench-pitch-plot-isolated --- .../bench/pitch/bench-pitch-plot-isolated | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100755 python/test/bench/pitch/bench-pitch-plot-isolated diff --git a/python/test/bench/pitch/bench-pitch-plot-isolated b/python/test/bench/pitch/bench-pitch-plot-isolated new file mode 100755 index 00000000..9bae85e8 --- /dev/null +++ b/python/test/bench/pitch/bench-pitch-plot-isolated @@ -0,0 +1,63 @@ +#! /usr/bin/python + +if __name__ == '__main__': + import sys, Gnuplot + from aubio.gnuplot import gnuplot_create + from aubio.txtfile import read_datafile + from aubio.plot.keyboard import draw_keyboard + lines = [] + titles = [] + for file in range(len(sys.argv)-1): + l = read_datafile(sys.argv[file+1]) + notes, score = [],[] + for i in range(len(l)): + notes.append(l[i][0]) + score.append(l[i][2]) + lines.append(Gnuplot.Data(notes,score, + with='linespoints', + title=sys.argv[file+1].split('.')[-1])) + titles.append(sys.argv[file+1].split('.')[-1]) + blacks,whites = draw_keyboard(firstnote = notes[0], lastnote = notes[-1], + y0= 40, y1 = 50) + + g = gnuplot_create(sys.argv[file+1].split('.')[-3],'ps') + #g = gnuplot_create('','') + #g = gnuplot_create('/tmp/test','eps') + g('set yrange [40:100]') + #g('set xrange [%f:%f]' % (notes[0],notes[-1]+60)) + g('set size 0.5') + g('set key outside') + + g('set border 3') + g('set xtics nomirror') + g('set ytics nomirror') + multiplot = 1 + oplots = lines + g('set size 1,2') + if multiplot: + height = 2. + g('set lmargin 10') + #g('set rmargin 15') + g('set multiplot') + g('set yrange [50:100]') + g('set xrange [%f:%f]' % (notes[0],notes[-1])) + g('set xtics %f,12' % notes[0]) + g('set nokey') + for i in range(len(oplots)): + g.ylabel(titles[i]) + g('set size %f,%f' % (1.,height*.85/float(len(oplots)))) + g('set origin 0,%f' % (height*(.15+.85*float(len(oplots)-i-1)/float(len(oplots))))) + g.plot(oplots[i]) + g('set title "Raw pitch accuracy (%) against midi note numbers"') + g('set noxtics') + g('set noytics') + g('set size %f,%f' % (1.,.15*height)) + g('set origin 0,%f' % 0) + g('set yrange [40:50]') + g('set xrange [%f:%f]' % (notes[0],notes[-1])) + g.xlabel('') + g.ylabel('') + g.plot(whites,blacks) + g('unset multiplot') + else: + g.plot(whites,blacks,*lines) -- 2.26.2