From 515c7b25b49fa76c19b1aaffcdd495cf407cba91 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Thu, 15 Oct 2009 20:46:32 +0200 Subject: [PATCH] python/: remove task.utils, not used anymore --- python/aubio/task/__init__.py | 1 - python/aubio/task/notes.py | 5 ++-- python/aubio/task/onset.py | 3 +-- python/aubio/task/pitch.py | 1 - python/aubio/task/utils.py | 43 ----------------------------------- 5 files changed, 3 insertions(+), 50 deletions(-) delete mode 100644 python/aubio/task/utils.py diff --git a/python/aubio/task/__init__.py b/python/aubio/task/__init__.py index 1c694205..9d274eaa 100644 --- a/python/aubio/task/__init__.py +++ b/python/aubio/task/__init__.py @@ -1,6 +1,5 @@ from aubio.aubioclass import * from aubio.task.task import task -from aubio.task.utils import * from aubio.task.params import taskparams from aubio.task.silence import tasksilence from aubio.task.onset import taskonset diff --git a/python/aubio/task/notes.py b/python/aubio/task/notes.py index 2554c98f..924f6235 100644 --- a/python/aubio/task/notes.py +++ b/python/aubio/task/notes.py @@ -1,6 +1,5 @@ from aubio.task import task -from aubio.task.utils import * from aubio.aubioclass import * class tasknotes(task): @@ -11,10 +10,10 @@ class tasknotes(task): self.channels, self.myvec, self.params.threshold, - mode=get_onset_mode(self.params.onsetmode), + mode=self.params.onsetmode, dcthreshold=self.params.dcthreshold, derivate=self.params.derivate) - self.pitchdet = pitchdetection(mode=get_pitch_mode(self.params.pitchmode), + self.pitchdet = pitchdetection(mode=self.params.pitchmode, bufsize=self.params.pbufsize, hopsize=self.params.phopsize, channels=self.channels, diff --git a/python/aubio/task/onset.py b/python/aubio/task/onset.py index 0d816031..83835b8e 100644 --- a/python/aubio/task/onset.py +++ b/python/aubio/task/onset.py @@ -1,5 +1,4 @@ from aubio.task.task import task -from aubio.task.utils import * from aubio.aubioclass import * class taskonset(task): @@ -13,7 +12,7 @@ class taskonset(task): self.channels, self.myvec, self.params.threshold, - mode=get_onset_mode(self.params.onsetmode), + mode=self.params.onsetmode, dcthreshold=self.params.dcthreshold, derivate=self.params.derivate) self.olist = [] diff --git a/python/aubio/task/pitch.py b/python/aubio/task/pitch.py index 1a10327d..7eed5e8f 100644 --- a/python/aubio/task/pitch.py +++ b/python/aubio/task/pitch.py @@ -1,6 +1,5 @@ from aubio.task.task import task from aubio.task.silence import tasksilence -from aubio.task.utils import * from aubio.aubioclass import * class taskpitch(task): diff --git a/python/aubio/task/utils.py b/python/aubio/task/utils.py deleted file mode 100644 index eb33f72e..00000000 --- a/python/aubio/task/utils.py +++ /dev/null @@ -1,43 +0,0 @@ -from aubio.aubioclass import * - -def get_onset_mode(nvalue): - """ utility function to convert a string to aubio_onsetdetection_type """ - if nvalue == 'complexdomain' or nvalue == 'complex' : - return aubio_onset_complex - elif nvalue == 'hfc' : - return aubio_onset_hfc - elif nvalue == 'phase' : - return aubio_onset_phase - elif nvalue == 'specdiff' : - return aubio_onset_specdiff - elif nvalue == 'energy' : - return aubio_onset_energy - elif nvalue == 'kl' : - return aubio_onset_kl - elif nvalue == 'mkl' : - return aubio_onset_mkl - elif nvalue == 'specflux' : - return aubio_onset_specflux - elif nvalue == 'dual' : - return 'dual' - else: - import sys - print "unknown onset detection function selected: %s" % nvalue - sys.exit(1) - -def check_onset_mode(option, opt, value, parser): - """ wrapper function to convert a list of modes to - aubio_onsetdetection_type """ - nvalues = parser.rargs[0].split(',') - val = [] - for nvalue in nvalues: - val.append(get_onset_mode(nvalue)) - setattr(parser.values, option.dest, val) - -def check_pitch_mode(option, opt, value, parser): - """ utility function to convert a string to aubio_pitchdetection_type""" - nvalues = parser.rargs[0].split(',') - val = [] - for nvalue in nvalues: - val.append(get_pitch_mode(nvalue)) - setattr(parser.values, option.dest, val) -- 2.26.2