History

add support for delay to task onset, invert silence output, remove unused import add support for delay to task onset, invert silence output, remove unused import

Paul Brossier committed 20 years ago

Commit 8d29cfe1 parent f72a10d1 file · +4 −3Browse files

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

Unified · Split

python/aubio/tasks.py+4−3
@@ -1,5 +1,4 @@
1from aubioclass import * 1from aubioclass import *
2from bench.node import bench
3 2
4def get_onset_mode(nvalue):3def get_onset_mode(nvalue):
5 """ utility function to convert a string to aubio_onsetdetection_type """4 """ utility function to convert a string to aubio_onsetdetection_type """
@@ -201,6 +200,7 @@ class taskparams(object): · 195 unmodified lines
201 self.silence = -70200 self.silence = -70
202 self.derivate = False201 self.derivate = False
203 self.localmin = False202 self.localmin = False
203 self.delay = 0.
204 self.storefunc = False204 self.storefunc = False
205 self.bufsize = 512205 self.bufsize = 512
206 self.hopsize = 256206 self.hopsize = 256
@@ -271,9 +271,9 @@ class tasksilence(task): · 64 unmodified lines
271 else: self.issilence = -1 271 else: self.issilence = -1
272 self.wassilence = 0272 self.wassilence = 0
273 if self.issilence == -1:273 if self.issilence == -1:
274 return -1, self.frameread 274 return self.frameread, -1
275 elif self.issilence == 2:275 elif self.issilence == 2:
276 return 2, self.frameread 276 return self.frameread, 2
277 277
278class taskpitch(task):278class taskpitch(task):
279 def __init__(self,input,params=None):279 def __init__(self,input,params=None):
@@ -373,6 +373,7 @@ class taskonset(task): · 93 unmodified lines
373 now = (self.frameread+1-i)373 now = (self.frameread+1-i)
374 else:374 else:
375 now = self.frameread375 now = self.frameread
376 if self.params.delay != 0.: now -= self.params.delay
376 if now < 0 :377 if now < 0 :
377 now = 0378 now = 0
378 return now, val 379 return now, val

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