- Timestamp:
- Aug 22, 2005, 9:52:17 PM (20 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:
- c29dae2
- Parents:
- f97445c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/pitchdetection.c
rf97445c raa17581 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 30 35 typedef smpl_t (*aubio_pitchdetection_func_t)(aubio_pitchdetection_t *p, 31 36 fvec_t * ibuf); 37 typedef smpl_t (*aubio_pitchdetection_conv_t)(smpl_t value); 32 38 void aubio_pitchdetection_slideblock(aubio_pitchdetection_t *p, fvec_t *ibuf); 33 39 … … 48 54 fvec_t * yin; 49 55 aubio_pitchdetection_func_t callback; 56 aubio_pitchdetection_conv_t freqconv; 50 57 }; 51 58 … … 60 67 p->srate = samplerate; 61 68 p->type = type; 69 p->mode = mode; 62 70 p->bufsize = bufsize; 63 71 switch(p->type) { … … 86 94 break; 87 95 } 96 switch(p->mode) { 97 case aubio_pitchm_freq: 98 p->freqconv = freqconvpass; 99 break; 100 case aubio_pitchm_midi: 101 p->freqconv = aubio_freqtomidi; 102 break; 103 case aubio_pitchm_cent: 104 /** bug: not implemented */ 105 p->freqconv = freqconvpass; 106 break; 107 case aubio_pitchm_bin: 108 /** bug: not implemented */ 109 p->freqconv = freqconvpass; 110 break; 111 default: 112 break; 113 } 88 114 return p; 89 115 } … … 132 158 133 159 smpl_t aubio_pitchdetection(aubio_pitchdetection_t *p, fvec_t * ibuf) { 134 return p-> callback(p,ibuf);160 return p->freqconv(p->callback(p,ibuf)); 135 161 } 136 162
Note: See TracChangeset
for help on using the changeset viewer.