- Timestamp:
- Dec 31, 2013, 12:20:28 AM (11 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:
- 5644069
- Parents:
- fe87823
- Location:
- src
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
src/cvec.c
rfe87823 rc21acb9 23 23 24 24 cvec_t * new_cvec( uint_t length) { 25 cvec_t * s; 25 26 if ((sint_t)length <= 0) { 26 27 return NULL; 27 28 } 28 cvec_t *s = AUBIO_NEW(cvec_t);29 s = AUBIO_NEW(cvec_t); 29 30 s->length = length/2 + 1; 30 31 s->norm = AUBIO_ARRAY(smpl_t,s->length); -
src/fmat.c
rfe87823 rc21acb9 23 23 24 24 fmat_t * new_fmat (uint_t height, uint_t length) { 25 fmat_t * s; 26 uint_t i,j; 25 27 if ((sint_t)length <= 0 || (sint_t)height <= 0 ) { 26 28 return NULL; 27 29 } 28 fmat_t * s = AUBIO_NEW(fmat_t); 29 uint_t i,j; 30 s = AUBIO_NEW(fmat_t); 30 31 s->height = height; 31 32 s->length = length; … … 127 128 128 129 void fmat_copy(fmat_t *s, fmat_t *t) { 130 uint_t i; 131 #if !HAVE_MEMCPY_HACKS 132 uint_t i,j; 133 #endif 129 134 if (s->height != t->height) { 130 135 AUBIO_ERR("trying to copy %d rows to %d rows \n", … … 138 143 } 139 144 #if HAVE_MEMCPY_HACKS 140 uint_t i;141 145 for (i=0; i< s->height; i++) { 142 146 memcpy(t->data[i], s->data[i], t->length * sizeof(smpl_t)); 143 147 } 144 148 #else 145 uint_t i,j;146 149 for (i=0; i< t->height; i++) { 147 150 for (j=0; j< t->length; j++) { -
src/fvec.c
rfe87823 rc21acb9 23 23 24 24 fvec_t * new_fvec( uint_t length) { 25 fvec_t * s; 25 26 if ((sint_t)length <= 0) { 26 27 return NULL; 27 28 } 28 fvec_t *s = AUBIO_NEW(fvec_t);29 s = AUBIO_NEW(fvec_t); 29 30 s->length = length; 30 31 s->data = AUBIO_ARRAY(smpl_t, s->length); -
src/io/sink_sndfile.c
rfe87823 rc21acb9 47 47 aubio_sink_sndfile_t * new_aubio_sink_sndfile(char_t * path, uint_t samplerate) { 48 48 aubio_sink_sndfile_t * s = AUBIO_NEW(aubio_sink_sndfile_t); 49 SF_INFO sfinfo; 49 50 50 51 if (path == NULL) { … … 59 60 60 61 /* set output format */ 61 SF_INFO sfinfo;62 62 AUBIO_MEMSET(&sfinfo, 0, sizeof (sfinfo)); 63 63 sfinfo.samplerate = s->samplerate; … … 92 92 int nsamples = channels*write; 93 93 smpl_t *pwrite; 94 sf_count_t written_frames; 94 95 95 96 if (write > s->max_size) { … … 107 108 } 108 109 109 sf_count_twritten_frames = sf_write_float (s->handle, s->scratch_data, nsamples);110 written_frames = sf_write_float (s->handle, s->scratch_data, nsamples); 110 111 if (written_frames/channels != write) { 111 112 AUBIO_WRN("trying to write %d frames to %s, but only %d could be written", -
src/lvec.c
rfe87823 rc21acb9 23 23 24 24 lvec_t * new_lvec( uint_t length) { 25 lvec_t * s; 25 26 if ((sint_t)length <= 0) { 26 27 return NULL; 27 28 } 28 lvec_t *s = AUBIO_NEW(lvec_t);29 s = AUBIO_NEW(lvec_t); 29 30 s->length = length; 30 31 s->data = AUBIO_ARRAY(lsmp_t, s->length); -
src/mathutils.c
rfe87823 rc21acb9 50 50 { 51 51 fvec_t * win = new_fvec (length); 52 uint_t err; 52 53 if (win == NULL) { 53 54 return NULL; 54 55 } 55 uint_terr = fvec_set_window (win, window_type);56 err = fvec_set_window (win, window_type); 56 57 if (err != 0) { 57 58 del_fvec(win); -
src/pitch/pitch.c
rfe87823 rc21acb9 367 367 aubio_pitch_do_specacf (aubio_pitch_t * p, fvec_t * ibuf, fvec_t * out) 368 368 { 369 smpl_t pitch = 0., period; 369 370 aubio_pitch_slideblock (p, ibuf); 370 371 aubio_pitchspecacf_do (p->p_object, p->buf, out); 371 372 //out->data[0] = aubio_bintofreq (out->data[0], p->samplerate, p->bufsize); 372 smpl_t pitch = 0.,period = out->data[0];373 period = out->data[0]; 373 374 if (period > 0) { 374 375 pitch = p->samplerate / period; -
src/pitch/pitchspecacf.c
rfe87823 rc21acb9 57 57 aubio_pitchspecacf_do (aubio_pitchspecacf_t * p, fvec_t * input, fvec_t * output) 58 58 { 59 uint_t l ;59 uint_t l, tau; 60 60 fvec_t *fftout = p->fftout; 61 61 // window the input … … 75 75 } 76 76 // get the minimum 77 uint_ttau = fvec_min_elem (p->acf);77 tau = fvec_min_elem (p->acf); 78 78 // get the interpolated minimum 79 79 output->data[0] = fvec_quadratic_peak_pos (p->acf, tau) * 2.; -
src/pitch/pitchyinfft.c
rfe87823 rc21acb9 58 58 new_aubio_pitchyinfft (uint_t samplerate, uint_t bufsize) 59 59 { 60 uint_t i = 0, j = 1; 61 smpl_t freq = 0, a0 = 0, a1 = 0, f0 = 0, f1 = 0; 60 62 aubio_pitchyinfft_t *p = AUBIO_NEW (aubio_pitchyinfft_t); 61 63 p->winput = new_fvec (bufsize); … … 67 69 p->win = new_aubio_window ("hanningz", bufsize); 68 70 p->weight = new_fvec (bufsize / 2 + 1); 69 uint_t i = 0, j = 1;70 smpl_t freq = 0, a0 = 0, a1 = 0, f0 = 0, f1 = 0;71 71 for (i = 0; i < p->weight->length; i++) { 72 72 freq = (smpl_t) i / (smpl_t) bufsize *(smpl_t) samplerate; -
src/synth/wavetable.c
rfe87823 rc21acb9 43 43 aubio_wavetable_t *new_aubio_wavetable(uint_t samplerate, uint_t blocksize) 44 44 { 45 uint_t i = 0; 45 46 aubio_wavetable_t *s = AUBIO_NEW(aubio_wavetable_t); 46 47 if ((sint_t)samplerate <= 0) { … … 48 49 goto beach; 49 50 } 50 uint_t i = 0;51 51 s->samplerate = samplerate; 52 52 s->blocksize = blocksize; … … 115 115 for (j = 0; j < output->length; j++) { 116 116 smpl_t inc = aubio_parameter_get_next_value( s->freq ); 117 smpl_t amp = aubio_parameter_get_next_value ( s->amp ); 117 118 inc *= (smpl_t)(s->wavetable_length) / (smpl_t) (s->samplerate); 118 119 pos += inc; … … 120 121 pos -= s->wavetable_length; 121 122 } 122 smpl_t amp = aubio_parameter_get_next_value ( s->amp );123 123 for (i = 0; i < output->height; i++) { 124 124 output->data[i][j] = amp * interp_2(s->wavetable, pos); -
src/tempo/beattracking.c
rfe87823 rc21acb9 62 62 aubio_beattracking_t *p = AUBIO_NEW (aubio_beattracking_t); 63 63 uint_t i = 0; 64 p->hop_size = hop_size;65 p->samplerate = samplerate;66 64 /* default value for rayleigh weighting - sets preferred tempo to 120bpm */ 67 65 smpl_t rayparam = 60. * samplerate / 120. / hop_size; … … 73 71 uint_t step = winlen / 4; /* 1.5 seconds */ 74 72 73 p->hop_size = hop_size; 74 p->samplerate = samplerate; 75 75 p->lastbeat = 0; 76 76 p->counter = 0; -
src/temporal/a_weighting.c
rfe87823 rc21acb9 29 29 aubio_filter_set_a_weighting (aubio_filter_t * f, uint_t samplerate) 30 30 { 31 uint_t order; lsmp_t *a, *b; lvec_t *as, *bs; 31 32 aubio_filter_set_samplerate (f, samplerate); 32 lvec_t *bs = aubio_filter_get_feedforward (f);33 lvec_t *as = aubio_filter_get_feedback (f);34 lsmp_t *b = bs->data, *a = as->data;35 uint_torder = aubio_filter_get_order (f);33 bs = aubio_filter_get_feedforward (f); 34 as = aubio_filter_get_feedback (f); 35 b = bs->data, a = as->data; 36 order = aubio_filter_get_order (f); 36 37 37 38 if (order != 7) { -
src/temporal/c_weighting.c
rfe87823 rc21acb9 29 29 aubio_filter_set_c_weighting (aubio_filter_t * f, uint_t samplerate) 30 30 { 31 uint_t order; lsmp_t *a, *b; lvec_t *as, *bs; 31 32 aubio_filter_set_samplerate (f, samplerate); 32 lvec_t *bs = aubio_filter_get_feedforward (f);33 lvec_t *as = aubio_filter_get_feedback (f);34 lsmp_t *b = bs->data, *a = as->data;35 uint_torder = aubio_filter_get_order (f);33 bs = aubio_filter_get_feedforward (f); 34 as = aubio_filter_get_feedback (f); 35 b = bs->data, a = as->data; 36 order = aubio_filter_get_order (f); 36 37 37 38 if ( order != 5 ) {
Note: See TracChangeset
for help on using the changeset viewer.