Changeset 3ec9d9c
- Timestamp:
- Aug 23, 2005, 12:53:38 AM (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:
- 4cc9fe5
- Parents:
- 79c2e52
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/pitchdetection.c
r79c2e52 r3ec9d9c 28 28 #include "pitchdetection.h" 29 29 30 smpl_t freqconvpass(smpl_t f);31 smpl_t freqconvpass(smpl_t f){32 return f;33 }34 35 30 typedef smpl_t (*aubio_pitchdetection_func_t)(aubio_pitchdetection_t *p, 36 31 fvec_t * ibuf); 37 typedef smpl_t (*aubio_pitchdetection_conv_t)(smpl_t value );32 typedef smpl_t (*aubio_pitchdetection_conv_t)(smpl_t value,uint_t srate,uint_t bufsize); 38 33 void aubio_pitchdetection_slideblock(aubio_pitchdetection_t *p, fvec_t *ibuf); 39 34 … … 57 52 }; 58 53 54 /* convenience wrapper function for frequency unit conversions 55 * should probably be rewritten with #defines */ 56 smpl_t freqconvbin(smpl_t f,uint_t srate,uint_t bufsize); 57 smpl_t freqconvbin(smpl_t f,uint_t srate,uint_t bufsize){ 58 return aubio_freqtobin(f,srate,bufsize); 59 } 60 61 smpl_t freqconvmidi(smpl_t f,uint_t srate,uint_t bufsize); 62 smpl_t freqconvmidi(smpl_t f,uint_t srate,uint_t bufsize){ 63 return aubio_freqtomidi(f); 64 } 65 66 smpl_t freqconvpass(smpl_t f,uint_t srate,uint_t bufsize); 67 smpl_t freqconvpass(smpl_t f,uint_t srate,uint_t bufsize){ 68 return f; 69 } 70 59 71 aubio_pitchdetection_t * new_aubio_pitchdetection(uint_t bufsize, 60 72 uint_t hopsize, … … 99 111 break; 100 112 case aubio_pitchm_midi: 101 p->freqconv = aubio_freqtomidi;113 p->freqconv = freqconvmidi; 102 114 break; 103 115 case aubio_pitchm_cent: 104 116 /** bug: not implemented */ 105 p->freqconv = freqconv pass;117 p->freqconv = freqconvmidi; 106 118 break; 107 119 case aubio_pitchm_bin: 108 /** bug: not implemented */ 109 p->freqconv = freqconvpass; 120 p->freqconv = freqconvbin; 110 121 break; 111 122 default: … … 158 169 159 170 smpl_t aubio_pitchdetection(aubio_pitchdetection_t *p, fvec_t * ibuf) { 160 return p->freqconv(p->callback(p,ibuf) );171 return p->freqconv(p->callback(p,ibuf),p->srate,p->bufsize); 161 172 } 162 173
Note: See TracChangeset
for help on using the changeset viewer.