Changeset 650e39b
- Timestamp:
- Mar 21, 2006, 11:59:17 PM (19 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- 4798fdf
- Parents:
- 4994ebb
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/puredata/aubiopitch~.c
r4994ebb r650e39b 13 13 char aubiopitch_version[] = "aubiopitch~ version 0.1"; 14 14 15 aubio_pitchdetection_type type_pitch = aubio_pitch_ mcomb;15 aubio_pitchdetection_type type_pitch = aubio_pitch_yinfft; 16 16 aubio_pitchdetection_mode mode_pitch = aubio_pitchm_freq; 17 17 … … 81 81 x->o = new_aubio_pitchdetection(x->bufsize*4, 82 82 x->hopsize, 1, 44100., type_pitch, mode_pitch); 83 aubio_pitchdetection_set_yinthresh(x->o, 0.7); 83 84 x->vec = (fvec_t *)new_fvec(x->hopsize,1); 84 85 -
python/aubio/task/pitch.py
r4994ebb r650e39b 8 8 task.__init__(self,input,params=params) 9 9 self.shortlist = [0. for i in range(self.params.pitchsmooth)] 10 if self.params.pitchmode == 'yinfft': 11 yinthresh = self.params.yinfftthresh 12 elif self.params.pitchmode == 'yin': 13 yinthresh = self.params.yinthresh 14 else: 15 yinthresh = 0. 10 16 self.pitchdet = pitchdetection(mode=get_pitch_mode(self.params.pitchmode), 11 17 bufsize=self.params.bufsize, … … 14 20 samplerate=self.srate, 15 21 omode=self.params.omode, 16 yinthresh= self.params.yinthresh)22 yinthresh=yinthresh) 17 23 18 24 def __call__(self): … … 68 74 while(tasksil.readsize==tasksil.params.hopsize): 69 75 tasksil() 70 time.append(tasksil.params.step* tasksil.frameread)76 time.append(tasksil.params.step*(tasksil.frameread)) 71 77 if not tasksil.issilence: 72 78 pitch.append(self.truth) … … 156 162 157 163 158 def plotplot(self,wplot,oplots,outplot=None,multiplot = 1, midi = 1):164 def plotplot(self,wplot,oplots,outplot=None,multiplot = 0, midi = 1): 159 165 from aubio.gnuplot import gnuplot_init, audio_to_array, make_audio_plot 160 166 import re … … 198 204 else: 199 205 g.ylabel('pitch (midi)') 200 g('set yrange [%f:%f]' % ( 40, aubio_freqtomidi(self.params.pitchmax)))206 g('set yrange [%f:%f]' % (aubio_freqtomidi(self.params.pitchmin), aubio_freqtomidi(self.params.pitchmax))) 201 207 g('set key right top') 202 208 g('set noclip one') -
python/aubio/task/utils.py
r4994ebb r650e39b 34 34 elif nvalue == 'schmitt': 35 35 return aubio_pitch_schmitt 36 elif nvalue == 'yinfft': 37 return aubio_pitch_yinfft 36 38 else: 37 39 import sys -
python/aubiopitch
r4994ebb r650e39b 90 90 params.bufsize = int(options.bufsize) 91 91 params.step = params.samplerate/float(params.hopsize) 92 params. threshold= float(options.threshold)92 params.yinthresh = float(options.threshold) 93 93 params.silence = float(options.silence) 94 94 params.verbose = options.verbose … … 100 100 if options.note: 101 101 exit("not implemented yet") 102 103 102 104 103 wplot,oplots = [],[] -
src/Makefile.am
r4994ebb r650e39b 18 18 pitchschmitt.h \ 19 19 pitchfcomb.h \ 20 pitchyinfft.h \ 20 21 beattracking.h \ 21 22 filter.h … … 57 58 pitchfcomb.c \ 58 59 pitchfcomb.h \ 60 pitchyinfft.c \ 61 pitchyinfft.h \ 59 62 beattracking.c \ 60 63 beattracking.h \ -
src/pitchdetection.c
r4994ebb r650e39b 26 26 #include "pitchfcomb.h" 27 27 #include "pitchschmitt.h" 28 #include "pitchyinfft.h" 28 29 #include "pitchdetection.h" 29 30 … … 44 45 aubio_pitchfcomb_t * fcomb; 45 46 aubio_pitchschmitt_t * schmitt; 47 aubio_pitchyinfft_t * yinfft; 46 48 aubio_filter_t * filter; 47 49 /* for yin */ … … 92 94 p->pv = new_aubio_pvoc(bufsize, hopsize, channels); 93 95 p->fftgrain = new_cvec(bufsize, channels); 94 p->mcomb = new_aubio_pitchmcomb(bufsize, channels,samplerate);96 p->mcomb = new_aubio_pitchmcomb(bufsize,hopsize,channels,samplerate); 95 97 p->filter = new_aubio_cdsgn_filter(samplerate); 96 98 p->callback = aubio_pitchdetection_mcomb; … … 105 107 p->schmitt = new_aubio_pitchschmitt(bufsize,samplerate); 106 108 p->callback = aubio_pitchdetection_schmitt; 109 break; 110 case aubio_pitch_yinfft: 111 p->buf = new_fvec(bufsize,channels); 112 p->yinfft = new_aubio_pitchyinfft(bufsize); 113 p->callback = aubio_pitchdetection_yinfft; 114 p->yinthres = 0.2; 107 115 break; 108 116 default: … … 147 155 del_fvec(p->buf); 148 156 del_aubio_pitchfcomb(p->fcomb); 157 break; 158 case aubio_pitch_yinfft: 159 del_fvec(p->buf); 160 del_aubio_pitchyinfft(p->yinfft); 149 161 break; 150 162 default: … … 206 218 207 219 220 smpl_t aubio_pitchdetection_yinfft(aubio_pitchdetection_t *p, fvec_t *ibuf){ 221 smpl_t pitch = 0.; 222 aubio_pitchdetection_slideblock(p,ibuf); 223 pitch = aubio_pitchyinfft_detect(p->yinfft,p->buf,p->yinthres); 224 if (pitch>0) { 225 pitch = p->srate/(pitch+0.); 226 } else { 227 pitch = 0.; 228 } 229 return pitch; 230 } 231 208 232 smpl_t aubio_pitchdetection_fcomb(aubio_pitchdetection_t *p, fvec_t *ibuf){ 209 233 aubio_pitchdetection_slideblock(p,ibuf); -
src/pitchdetection.h
r4994ebb r650e39b 28 28 aubio_pitch_mcomb, 29 29 aubio_pitch_schmitt, 30 aubio_pitch_fcomb 30 aubio_pitch_fcomb, 31 aubio_pitch_yinfft 31 32 } aubio_pitchdetection_type; 32 33 … … 45 46 smpl_t aubio_pitchdetection_schmitt(aubio_pitchdetection_t *p, fvec_t *ibuf); 46 47 smpl_t aubio_pitchdetection_fcomb(aubio_pitchdetection_t *p, fvec_t *ibuf); 48 smpl_t aubio_pitchdetection_yinfft(aubio_pitchdetection_t *p, fvec_t *ibuf); 47 49 48 50 void aubio_pitchdetection_set_yinthresh(aubio_pitchdetection_t *p, smpl_t thres); -
swig/aubio.i
r4994ebb r650e39b 191 191 aubio_pitch_mcomb, 192 192 aubio_pitch_schmitt, 193 aubio_pitch_fcomb 193 aubio_pitch_fcomb, 194 aubio_pitch_yinfft 194 195 } aubio_pitchdetection_type; 195 196 … … 218 219 219 220 /* pitch mcomb */ 220 aubio_pitchmcomb_t * new_aubio_pitchmcomb(uint_t size, uint_t channels, uint_t samplerate);221 aubio_pitchmcomb_t * new_aubio_pitchmcomb(uint_t bufsize, uint_t hopsize, uint_t channels, uint_t samplerate); 221 222 smpl_t aubio_pitchmcomb_detect(aubio_pitchmcomb_t * p, cvec_t * fftgrain); 222 223 uint_t aubio_pitch_cands(aubio_pitchmcomb_t * p, cvec_t * fftgrain, smpl_t * cands); … … 227 228 void aubio_pitchyin_getcum(fvec_t *yin); 228 229 uint_t aubio_pitchyin_getpitch(fvec_t *yin); 229 uint_t aubio_pitchyin_getpitchfast(fvec_t * input, fvec_t *yin, smpl_t tol);230 smpl_t aubio_pitchyin_getpitchfast(fvec_t * input, fvec_t *yin, smpl_t tol); 230 231 231 232 /* pitch schmitt */
Note: See TracChangeset
for help on using the changeset viewer.