Showing the changes to python/aubio (5 of 5 files). Show all
Unified · Split
| @@ -1,6 +1,5 @@ | ||
| 1 | 1 | from aubio.aubioclass import * |
| 2 | 2 | from aubio.task.task import task |
| 3 | −from aubio.task.utils import * | |
| 4 | 3 | from aubio.task.params import taskparams |
| 5 | 4 | from aubio.task.silence import tasksilence |
| 6 | 5 | from aubio.task.onset import taskonset |
| @@ -1,6 +1,5 @@ | ||
| 1 | 1 | |
| 2 | 2 | from aubio.task import task |
| 3 | −from aubio.task.utils import * | |
| 4 | 3 | from aubio.aubioclass import * |
| 5 | 4 | |
| 6 | 5 | class tasknotes(task): |
| @@ -11,10 +10,10 @@ class tasknotes(task): · 4 unmodified lines | ||
| 11 | 10 | self.channels, |
| 12 | 11 | self.myvec, |
| 13 | 12 | self.params.threshold, |
| 14 | − mode=get_onset_mode(self.params.onsetmode), | |
| 13 | + mode=self.params.onsetmode, | |
| 15 | 14 | dcthreshold=self.params.dcthreshold, |
| 16 | 15 | derivate=self.params.derivate) |
| 17 | − self.pitchdet = pitchdetection(mode=get_pitch_mode(self.params.pitchmode), | |
| 16 | + self.pitchdet = pitchdetection(mode=self.params.pitchmode, | |
| 18 | 17 | bufsize=self.params.pbufsize, |
| 19 | 18 | hopsize=self.params.phopsize, |
| 20 | 19 | channels=self.channels, |
| @@ -1,5 +1,4 @@ | ||
| 1 | 1 | from aubio.task.task import task |
| 2 | −from aubio.task.utils import * | |
| 3 | 2 | from aubio.aubioclass import * |
| 4 | 3 | |
| 5 | 4 | class taskonset(task): |
| @@ -13,7 +12,7 @@ class taskonset(task): · 7 unmodified lines | ||
| 13 | 12 | self.channels, |
| 14 | 13 | self.myvec, |
| 15 | 14 | self.params.threshold, |
| 16 | − mode=get_onset_mode(self.params.onsetmode), | |
| 15 | + mode=self.params.onsetmode, | |
| 17 | 16 | dcthreshold=self.params.dcthreshold, |
| 18 | 17 | derivate=self.params.derivate) |
| 19 | 18 | self.olist = [] |
| @@ -1,6 +1,5 @@ | ||
| 1 | 1 | from aubio.task.task import task |
| 2 | 2 | from aubio.task.silence import tasksilence |
| 3 | −from aubio.task.utils import * | |
| 4 | 3 | from aubio.aubioclass import * |
| 5 | 4 | |
| 6 | 5 | class taskpitch(task): |
| @@ -1,43 +0,0 @@ | ||
| 1 | −from aubio.aubioclass import * | |
| 2 | − | |
| 3 | −def get_onset_mode(nvalue): | |
| 4 | − """ utility function to convert a string to aubio_onsetdetection_type """ | |
| 5 | − if nvalue == 'complexdomain' or nvalue == 'complex' : | |
| 6 | − return aubio_onset_complex | |
| 7 | − elif nvalue == 'hfc' : | |
| 8 | − return aubio_onset_hfc | |
| 9 | − elif nvalue == 'phase' : | |
| 10 | − return aubio_onset_phase | |
| 11 | − elif nvalue == 'specdiff' : | |
| 12 | − return aubio_onset_specdiff | |
| 13 | − elif nvalue == 'energy' : | |
| 14 | − return aubio_onset_energy | |
| 15 | − elif nvalue == 'kl' : | |
| 16 | − return aubio_onset_kl | |
| 17 | − elif nvalue == 'mkl' : | |
| 18 | − return aubio_onset_mkl | |
| 19 | − elif nvalue == 'specflux' : | |
| 20 | − return aubio_onset_specflux | |
| 21 | − elif nvalue == 'dual' : | |
| 22 | − return 'dual' | |
| 23 | − else: | |
| 24 | − import sys | |
| 25 | − print "unknown onset detection function selected: %s" % nvalue | |
| 26 | − sys.exit(1) | |
| 27 | − | |
| 28 | −def check_onset_mode(option, opt, value, parser): | |
| 29 | − """ wrapper function to convert a list of modes to | |
| 30 | − aubio_onsetdetection_type """ | |
| 31 | − nvalues = parser.rargs[0].split(',') | |
| 32 | − val = [] | |
| 33 | − for nvalue in nvalues: | |
| 34 | − val.append(get_onset_mode(nvalue)) | |
| 35 | − setattr(parser.values, option.dest, val) | |
| 36 | − | |
| 37 | −def check_pitch_mode(option, opt, value, parser): | |
| 38 | − """ utility function to convert a string to aubio_pitchdetection_type""" | |
| 39 | − nvalues = parser.rargs[0].split(',') | |
| 40 | − val = [] | |
| 41 | − for nvalue in nvalues: | |
| 42 | − val.append(get_pitch_mode(nvalue)) | |
| 43 | − setattr(parser.values, option.dest, val) | |