Changeset 65f1edc
- Timestamp:
- Nov 30, 2004, 11:17:19 PM (20 years ago)
- 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:
- 09b082d
- Parents:
- 00e4659
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/aubiocut
r00e4659 r65f1edc 8 8 import sys 9 9 10 bufsize = 1024 11 hopsize = bufsize/2 12 10 13 def getonsets(filein,threshold): 11 bufsize = 102412 hopsize = bufsize/213 14 frameread = 0 14 15 filei = sndfile(filein) … … 21 22 #fileo = sndfile(newname,model=filei) 22 23 mylist = list() 24 ovalist = [0., 0., 0., 0., 0., 0.] 23 25 while(readsize==hopsize): 24 26 readsize = filei.read(hopsize,myvec) 25 27 isonset,val = opick.do(myvec) 28 ovalist.append(val) 29 ovalist.pop(0) 26 30 if (isonset == 1): 27 now = (frameread-4)*hopsize/(srate+0.) 28 #del fileo 29 #fileo = sndfile("%s%f%s" % ("/tmp/",now,filein[-4:]),model=filei) 30 mylist.append(now) 31 print frameread 32 i=len(ovalist)-1 33 # find local minima 34 while ovalist[i-1] < ovalist[i] and i > 0: 35 i -= 1 36 now = (frameread-i+1)*hopsize/(srate+0.) 37 #del fileo 38 #fileo = sndfile("%s%f%s" % ("/tmp/",now,filein[-4:]),model=filei) 39 mylist.append(now) 31 40 #writesize = fileo.write(readsize,myoldvec) 32 41 frameread += 1 … … 34 43 35 44 def cutfile(filein,onsets): 36 hopsize = 51237 45 frameread = 0 38 46 readsize = hopsize
Note: See TracChangeset
for help on using the changeset viewer.