History

add beat function add beat function

Paul Brossier committed 20 years ago

Commit ada5baf1 parent c32976a1 file · +12 −11Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/aubiocut+12−11
@@ -16,7 +16,7 @@ def parse_args(): · 15 unmodified lines
1616 action="store", dest="filename",
1717 help="input sound file")
1818 parser.add_option("-m","--mode",
19− action="store", dest="mode", default=['dual'],
19+ action="store", dest="mode", default='dual',
2020 help="onset detection mode [default=dual] \
2121 complexdomain|hfc|phase|specdiff|energy|kl|mkl|dual")
2222 parser.add_option("-B","--bufsize",
@@ -91,20 +91,22 @@ params.mintol = float(options.mintol) · 68 unmodified lines
9191 if options.delay: delay = float(options.delay)
9292 else: delay = 3./params.step
9393
94−if options.beat:
95− #onsets = getbeats(filename,threshold,silence,mode=options.mode)
96− exit("not implemented yet")
97−elif options.silencecut:
98− onsets = getsilences(filename,hopsize=hopsize,silence=silence)
99−elif options.plot: params.storefunc=True
100−else: params.storefunc=False
10194
10295 lonsets, lofunc = [], []
10396 modes = options.mode.split(',')
10497 for i in range(len(modes)):
10598
10699 params.onsetmode = modes[i]
107− filetask = taskonset(filename,params=params)
100+ dotask = taskonset
101+ if options.beat:
102+ dotask = taskbeat
103+ elif options.silencecut:
104+ dotask = tasksilence
105+ elif options.plot:
106+ params.storefunc=True
107+ else:
108+ params.storefunc=False
109+ filetask = dotask(filename,params=params)
108110 onsets = filetask.compute_all()
109111 ofunc = filetask.ofunc
110112 #onsets, ofunc = getonsets(filename,threshold,silence,
@@ -133,8 +135,7 @@ for i in range(len(modes)): · 22 unmodified lines
133135
134136 # print times in second
135137 if options.verbose:
136− print modes[i]
137− maxonset = 0
138+ #print modes[i]
138139 for i in range(len(onsets)):
139140 print onsets[i]*params.step
140141

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t