Changeset 650e39b for src/pitchdetection.c
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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);
Note: See TracChangeset
for help on using the changeset viewer.