From 8d29cfe3df450227c100acf2c9051737b0dd95d7 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Mon, 20 Feb 2006 11:33:18 +0000 Subject: [PATCH] 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 --- python/aubio/tasks.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/aubio/tasks.py b/python/aubio/tasks.py index f8069a9c..2bb4289e 100644 --- a/python/aubio/tasks.py +++ b/python/aubio/tasks.py @@ -1,5 +1,4 @@ from aubioclass import * -from bench.node import bench def get_onset_mode(nvalue): """ utility function to convert a string to aubio_onsetdetection_type """ @@ -201,6 +200,7 @@ class taskparams(object): self.silence = -70 self.derivate = False self.localmin = False + self.delay = 0. self.storefunc = False self.bufsize = 512 self.hopsize = 256 @@ -271,9 +271,9 @@ class tasksilence(task): else: self.issilence = -1 self.wassilence = 0 if self.issilence == -1: - return -1, self.frameread + return self.frameread, -1 elif self.issilence == 2: - return 2, self.frameread + return self.frameread, 2 class taskpitch(task): def __init__(self,input,params=None): @@ -373,6 +373,7 @@ class taskonset(task): now = (self.frameread+1-i) else: now = self.frameread + if self.params.delay != 0.: now -= self.params.delay if now < 0 : now = 0 return now, val -- 2.26.2