ref: d4a6eb9c49e9a5f755a4c4d46570b0e970adbd34
dir: /python/aubioplot-notes/
#!/usr/bin/python def parse_args (sysargs): from getopt import gnu_getopt shortopts ='i:o:' longopts =('input=','output=') args,tmp = gnu_getopt(sysargs,shortopts,longopts) args.sort() filein,fileout= None,None for i in range(len(args)): # a bad way if args[i][0] == '-i' or args[i][0] == '--input': filein = args[i][1] if args[i][0] == '-o' or args[i][0] == '--output': fileout = args[i][1] assert filein != None, 'precise filein' return filein,fileout def main (sysargs) : from aubio.txtfile import read_datafile from aubio.gnuplot import plotnote,plotnote_do from numarray import array filein,fileout = parse_args(sysargs) #print 'checking', fileerr, 'against', fileorg """ load midi and raw data """ d = plotnote(array(read_datafile(filein)),title=filein) plotnote_do(d,fileout=fileout) if __name__ == "__main__": import sys main(sys.argv[1:])