- Timestamp:
- Nov 26, 2018, 11:34:45 AM (6 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
- Children:
- ce323e4
- Parents:
- bcc5387 (diff), ef0a430 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tempo/tempo.c
rbcc5387 r1cf031a 129 129 130 130 uint_t aubio_tempo_set_delay_ms(aubio_tempo_t * o, smpl_t delay) { 131 o->delay = 1000. * delay * o->samplerate; 132 return AUBIO_OK; 131 return aubio_tempo_set_delay_s(o, delay / 1000.); 133 132 } 134 133 … … 142 141 143 142 smpl_t aubio_tempo_get_delay_ms(aubio_tempo_t * o) { 144 return o->delay / (smpl_t)(o->samplerate) /1000.;143 return aubio_tempo_get_delay_s(o) * 1000.; 145 144 } 146 145 … … 169 168 { 170 169 aubio_tempo_t * o = AUBIO_NEW(aubio_tempo_t); 171 char_t specdesc_func[ 20];170 char_t specdesc_func[PATH_MAX]; 172 171 o->samplerate = samplerate; 173 172 // check parameters are valid … … 204 203 aubio_peakpicker_set_threshold (o->pp, o->threshold); 205 204 if ( strcmp(tempo_mode, "default") == 0 ) { 206 str cpy(specdesc_func, "specflux");205 strncpy(specdesc_func, "specflux", PATH_MAX - 1); 207 206 } else { 208 strcpy(specdesc_func, tempo_mode); 207 strncpy(specdesc_func, tempo_mode, PATH_MAX - 1); 208 specdesc_func[PATH_MAX - 1] = '\0'; 209 209 } 210 210 o->od = new_aubio_specdesc(specdesc_func,buf_size); … … 216 216 onset2 = new_fvec(1); 217 217 }*/ 218 if (!o->dfframe || !o->fftgrain || !o->out || !o->pv || 219 !o->pp || !o->od || !o->of || !o->bt || !o->onset) { 220 AUBIO_ERR("tempo: failed creating tempo object\n"); 221 goto beach; 222 } 218 223 o->last_tatum = 0; 219 224 o->tatum_signature = 4; … … 221 226 222 227 beach: 223 AUBIO_FREE(o);228 del_aubio_tempo(o); 224 229 return NULL; 225 230 } … … 278 283 void del_aubio_tempo (aubio_tempo_t *o) 279 284 { 280 del_aubio_specdesc(o->od); 281 del_aubio_beattracking(o->bt); 282 del_aubio_peakpicker(o->pp); 283 del_aubio_pvoc(o->pv); 284 del_fvec(o->out); 285 del_fvec(o->of); 286 del_cvec(o->fftgrain); 287 del_fvec(o->dfframe); 288 del_fvec(o->onset); 285 if (o->od) 286 del_aubio_specdesc(o->od); 287 if (o->bt) 288 del_aubio_beattracking(o->bt); 289 if (o->pp) 290 del_aubio_peakpicker(o->pp); 291 if (o->pv) 292 del_aubio_pvoc(o->pv); 293 if (o->out) 294 del_fvec(o->out); 295 if (o->of) 296 del_fvec(o->of); 297 if (o->fftgrain) 298 del_cvec(o->fftgrain); 299 if (o->dfframe) 300 del_fvec(o->dfframe); 301 if (o->onset) 302 del_fvec(o->onset); 289 303 AUBIO_FREE(o); 290 return; 291 } 304 }
Note: See TracChangeset
for help on using the changeset viewer.