- 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
- Location:
- src
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
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);
Note: See TracChangeset
for help on using the changeset viewer.