source: python/aubioplot-notes @ 1cc007c

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 1cc007c was e7a7794, checked in by Paul Brossier <piem@piem.org>, 15 years ago

python: finish getting rid of numarray

  • Property mode set to 100755
File size: 1.0 KB
RevLine 
[96fb8ad]1#!/usr/bin/python
2
3def parse_args (sysargs):
4        from getopt import gnu_getopt
5        shortopts ='i:o:'
6        longopts =('input=','output=')
7        args,tmp = gnu_getopt(sysargs,shortopts,longopts)
8        args.sort()
9        filein,fileout= None,None
10        for i in range(len(args)):  # a bad way
11                if args[i][0] == '-i' or args[i][0] == '--input':
12                        filein =  args[i][1]
13                if args[i][0] == '-o' or args[i][0] == '--output':
14                        fileout =  args[i][1]
15        assert filein != None, 'precise filein'
16        return filein,fileout
17
18def main (sysargs) :
19    from aubio.txtfile import read_datafile
20    from aubio.gnuplot import plotnote,plotnote_do
[e7a7794]21    from numpy import array
[96fb8ad]22    filein,fileout = parse_args(sysargs)
23    #print 'checking', fileerr, 'against', fileorg
24    """ load midi and raw data """
25    d = plotnote(array(read_datafile(filein)),title=filein)
26    plotnote_do(d,fileout=fileout)
27
28if __name__ == "__main__":
29    import sys 
30    main(sys.argv[1:])
31
Note: See TracBrowser for help on using the repository browser.