Showing the changes to python (5 of 5 files). Show all
Unified · Split
| @@ -1,6 +1,5 @@ | |||
| 1 | from aubio.aubioclass import * | 1 | from aubio.aubioclass import * |
| 2 | from aubio.task.task import task | 2 | from aubio.task.task import task |
| 3 | from aubio.task.utils import * | ||
| 4 | from aubio.task.params import taskparams | 3 | from aubio.task.params import taskparams |
| 5 | from aubio.task.silence import tasksilence | 4 | from aubio.task.silence import tasksilence |
| 6 | from aubio.task.onset import taskonset | 5 | from aubio.task.onset import taskonset |
| @@ -1,6 +1,5 @@ | |||
| 1 | 1 | ||
| 2 | from aubio.task import task | 2 | from aubio.task import task |
| 3 | from aubio.task.utils import * | ||
| 4 | from aubio.aubioclass import * | 3 | from aubio.aubioclass import * |
| 5 | 4 | ||
| 6 | class tasknotes(task): | 5 | class tasknotes(task): |
| @@ -11,10 +10,10 @@ class tasknotes(task): · 4 unmodified lines | |||
| 11 | self.channels, | 10 | self.channels, |
| 12 | self.myvec, | 11 | self.myvec, |
| 13 | self.params.threshold, | 12 | self.params.threshold, |
| 14 | mode=get_onset_mode(self.params.onsetmode), | 13 | mode=self.params.onsetmode, |
| 15 | dcthreshold=self.params.dcthreshold, | 14 | dcthreshold=self.params.dcthreshold, |
| 16 | derivate=self.params.derivate) | 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 | bufsize=self.params.pbufsize, | 17 | bufsize=self.params.pbufsize, |
| 19 | hopsize=self.params.phopsize, | 18 | hopsize=self.params.phopsize, |
| 20 | channels=self.channels, | 19 | channels=self.channels, |
| @@ -1,5 +1,4 @@ | |||
| 1 | from aubio.task.task import task | 1 | from aubio.task.task import task |
| 2 | from aubio.task.utils import * | ||
| 3 | from aubio.aubioclass import * | 2 | from aubio.aubioclass import * |
| 4 | 3 | ||
| 5 | class taskonset(task): | 4 | class taskonset(task): |
| @@ -13,7 +12,7 @@ class taskonset(task): · 7 unmodified lines | |||
| 13 | self.channels, | 12 | self.channels, |
| 14 | self.myvec, | 13 | self.myvec, |
| 15 | self.params.threshold, | 14 | self.params.threshold, |
| 16 | mode=get_onset_mode(self.params.onsetmode), | 15 | mode=self.params.onsetmode, |
| 17 | dcthreshold=self.params.dcthreshold, | 16 | dcthreshold=self.params.dcthreshold, |
| 18 | derivate=self.params.derivate) | 17 | derivate=self.params.derivate) |
| 19 | self.olist = [] | 18 | self.olist = [] |
| @@ -1,6 +1,5 @@ | |||
| 1 | from aubio.task.task import task | 1 | from aubio.task.task import task |
| 2 | from aubio.task.silence import tasksilence | 2 | from aubio.task.silence import tasksilence |
| 3 | from aubio.task.utils import * | ||
| 4 | from aubio.aubioclass import * | 3 | from aubio.aubioclass import * |
| 5 | 4 | ||
| 6 | class taskpitch(task): | 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) | ||