ref: 8fe9c106e1874e663091dd28e88dd2082db56217
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 numpy 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:])