Changeset d4791e5
- Timestamp:
- Jan 3, 2014, 12:47:22 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:
- 2e01060
- Parents:
- 89e9e71 (diff), 4fe62ba (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. - Files:
-
- 66 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/aubiomfcc.c
r89e9e71 rd4791e5 30 30 uint_t n_coefs = 13; 31 31 32 static void 33 process_block(fvec_t *ibuf, fvec_t *obuf){32 void process_block (fvec_t *ibuf, fvec_t *obuf) 33 { 34 34 fvec_zeros(obuf); 35 35 //compute mag spectrum … … 39 39 } 40 40 41 static void process_print (void) { 41 void process_print (void) 42 { 42 43 /* output times in seconds and extracted mfccs */ 43 44 outmsg("%f\t",blocks*hop_size/(float)samplerate); -
examples/aubionotes.c
r89e9e71 rd4791e5 46 46 uint_t get_note (fvec_t * note_buffer, fvec_t * note_buffer2); 47 47 48 static void 49 process_block(fvec_t *ibuf, fvec_t *obuf) { 48 void process_block (fvec_t *ibuf, fvec_t *obuf) 49 { 50 smpl_t new_pitch, curlevel; 50 51 fvec_zeros(obuf); 51 52 aubio_onset_do(o, ibuf, onset); 52 53 53 54 aubio_pitch_do (pitch, ibuf, pitch_obuf); 54 smpl_tnew_pitch = fvec_get_sample(pitch_obuf, 0);55 new_pitch = fvec_get_sample(pitch_obuf, 0); 55 56 if(median){ 56 57 note_append(note_buffer, new_pitch); … … 58 59 59 60 /* curlevel is negatif or 1 if silence */ 60 smpl_tcurlevel = aubio_level_detection(ibuf, silence_threshold);61 curlevel = aubio_level_detection(ibuf, silence_threshold); 61 62 if (fvec_get_sample(onset, 0)) { 62 63 /* test for silence */ … … 95 96 } 96 97 97 static void 98 process_print (void){98 void process_print (void) 99 { 99 100 //if (verbose) outmsg("%f\n",pitch_obuf->data[0]); 100 101 } -
examples/aubioonset.c
r89e9e71 rd4791e5 30 30 smpl_t is_onset; 31 31 32 void 33 process_block(fvec_t *ibuf, fvec_t *obuf) { 34 fvec_zeros(obuf); 32 void process_block(fvec_t *ibuf, fvec_t *obuf) 33 { 35 34 aubio_onset_do (o, ibuf, onset); 36 35 is_onset = fvec_get_sample(onset, 0); 36 if ( !usejack && ! sink_uri ) return; 37 fvec_zeros(obuf); 37 38 if ( is_onset ) { 38 39 aubio_wavetable_play ( wavetable ); … … 46 47 } 47 48 48 void 49 process_print (void) 49 void process_print (void) 50 50 { 51 51 if ( is_onset ) { -
examples/aubiopitch.c
r89e9e71 rd4791e5 29 29 fvec_t *pitch; 30 30 31 void 32 process_block(fvec_t * ibuf, fvec_t * obuf) { 31 void process_block(fvec_t * ibuf, fvec_t * obuf) 32 { 33 smpl_t freq; 34 aubio_pitch_do (o, ibuf, pitch); 35 if ( !usejack && ! sink_uri ) return; 33 36 fvec_zeros(obuf); 34 aubio_pitch_do (o, ibuf, pitch); 35 smpl_t freq = fvec_get_sample(pitch, 0); 37 freq = fvec_get_sample(pitch, 0); 36 38 aubio_wavetable_set_amp ( wavetable, aubio_level_lin (ibuf) ); 37 39 aubio_wavetable_set_freq ( wavetable, freq ); 38 39 40 if (mix_input) 40 41 aubio_wavetable_do (wavetable, ibuf, obuf); … … 43 44 } 44 45 45 void 46 process_print (void){46 void process_print (void) 47 { 47 48 smpl_t pitch_found = fvec_get_sample(pitch, 0); 48 49 outmsg("%f %f\n",(blocks) -
examples/aubioquiet.c
r89e9e71 rd4791e5 37 37 } 38 38 39 staticvoid process_print (void) {39 void process_print (void) { 40 40 int curblocks = (blocks - 4) > 0 ? blocks - 4 : 0; 41 41 if (issilence == -1) { -
examples/aubiotrack.c
r89e9e71 rd4791e5 36 36 if (silence_threshold != -90.) 37 37 is_silence = aubio_silence_detection(ibuf, silence_threshold); 38 if ( !usejack && ! sink_uri ) return; 38 39 fvec_zeros (obuf); 39 40 if ( is_beat && !is_silence ) { -
examples/parse_args.h
r89e9e71 rd4791e5 48 48 extern void examples_common_process (aubio_process_func_t process_func, 49 49 aubio_print_func_t print); 50 int parse_args (int argc, char **argv); 50 51 51 52 // internal stuff … … 57 58 const char *prog_name; 58 59 59 void 60 usage (FILE * stream, int exit_code) 60 void usage (FILE * stream, int exit_code); 61 62 void usage (FILE * stream, int exit_code) 61 63 { 62 64 fprintf (stream, "usage: %s [ options ] \n", prog_name); -
examples/utils.c
r89e9e71 rd4791e5 73 73 #endif 74 74 75 void 76 examples_common_init (int argc, char **argv) 75 void examples_common_init (int argc, char **argv); 76 void examples_common_del (void); 77 void examples_common_process (aubio_process_func_t process_func, 78 aubio_print_func_t print); 79 80 void examples_common_init (int argc, char **argv) 77 81 { 78 82 … … 116 120 } 117 121 118 void 119 examples_common_del (void) 122 void examples_common_del (void) 120 123 { 121 124 del_fvec (ibuf); … … 126 129 } 127 130 128 void 129 examples_common_process (aubio_process_func_t process_func, 131 void examples_common_process (aubio_process_func_t process_func, 130 132 aubio_print_func_t print) 131 133 { … … 146 148 147 149 } else { 148 /* phasevoc */ 150 151 uint_t total_read = 0; 149 152 blocks = 0; 150 uint_t total_read = 0;151 153 152 154 do { -
examples/utils.h
r89e9e71 rd4791e5 42 42 #define debug(...) fprintf (stderr, format , **args) 43 43 #else 44 #define debug(...) ()44 #define debug(...) 45 45 #endif 46 46 #define verbmsg(format, args...) if (verbose) fprintf(stderr, format , ##args) … … 54 54 /** common process function */ 55 55 typedef int (*aubio_process_func_t) (fvec_t * input, fvec_t * output); 56 57 void process_block (fvec_t *ibuf, fvec_t *obuf); 58 void process_print (void); -
src/aubio_priv.h
r89e9e71 rd4791e5 34 34 */ 35 35 36 #if 1 //HAVE_CONFIG_H37 36 #include "config.h" 38 #endif39 37 40 38 #if HAVE_STDLIB_H … … 47 45 48 46 /* must be included before fftw3.h */ 49 #if HAVE_COMPLEX_H47 #ifdef HAVE_COMPLEX_H 50 48 #include <complex.h> 51 49 #endif 52 50 53 #if HAVE_FFTW3 || HAVE_FFTW3F51 #if defined(HAVE_FFTW3) || defined(HAVE_FFTW3F) 54 52 #include <fftw3.h> 55 53 #endif 56 54 57 #if HAVE_MATH_H55 #ifdef HAVE_MATH_H 58 56 #include <math.h> 59 57 #endif 60 58 61 #if HAVE_STRING_H59 #ifdef HAVE_STRING_H 62 60 #include <string.h> 63 61 #endif 64 62 65 #if HAVE_LIMITS_H63 #ifdef HAVE_LIMITS_H 66 64 #include <limits.h> // for CHAR_BIT, in C99 standard 67 65 #endif -
src/cvec.c
r89e9e71 rd4791e5 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
r89e9e71 rd4791e5 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
r89e9e71 rd4791e5 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
r89e9e71 rd4791e5 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/io/source_avcodec.c
r89e9e71 rd4791e5 62 62 // hack to create or re-create the context the first time _do or _do_multi is called 63 63 void aubio_source_avcodec_reset_resampler(aubio_source_avcodec_t * s, uint_t multi); 64 void aubio_source_avcodec_readframe(aubio_source_avcodec_t *s, uint_t * read_samples); 64 65 65 66 aubio_source_avcodec_t * new_aubio_source_avcodec(char_t * path, uint_t samplerate, uint_t hop_size) { … … 279 280 (uint8_t **)avFrame->data, in_linesize, in_samples); 280 281 if (out_samples <= 0) { 281 AUBIO_ERR("No sample found while converting frame (%s)\n", s->path);282 //AUBIO_ERR("No sample found while converting frame (%s)\n", s->path); 282 283 goto beach; 283 284 } -
src/io/source_sndfile.c
r89e9e71 rd4791e5 64 64 aubio_source_sndfile_t * new_aubio_source_sndfile(char_t * path, uint_t samplerate, uint_t hop_size) { 65 65 aubio_source_sndfile_t * s = AUBIO_NEW(aubio_source_sndfile_t); 66 SF_INFO sfinfo; 66 67 67 68 if (path == NULL) { … … 83 84 84 85 // try opening the file, getting the info in sfinfo 85 SF_INFO sfinfo;86 86 AUBIO_MEMSET(&sfinfo, 0, sizeof (sfinfo)); 87 87 s->handle = sf_open (s->path, SFM_READ, &sfinfo); -
src/lvec.c
r89e9e71 rd4791e5 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); … … 37 38 } 38 39 39 void lvec_ write_sample(lvec_t *s, lsmp_t data, uint_t position) {40 void lvec_set_sample(lvec_t *s, lsmp_t data, uint_t position) { 40 41 s->data[position] = data; 41 42 } 43 42 44 lsmp_t lvec_get_sample(lvec_t *s, uint_t position) { 43 45 return s->data[position]; -
src/mathutils.c
r89e9e71 rd4791e5 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); … … 417 418 418 419 smpl_t fvec_quadratic_peak_pos (fvec_t * x, uint_t pos) { 419 smpl_t s0, s1, s2; 420 smpl_t s0, s1, s2; uint_t x0, x2; 420 421 if (pos == 0 || pos == x->length - 1) return pos; 421 uint_tx0 = (pos < 1) ? pos : pos - 1;422 uint_tx2 = (pos + 1 < x->length) ? pos + 1 : pos;422 x0 = (pos < 1) ? pos : pos - 1; 423 x2 = (pos + 1 < x->length) ? pos + 1 : pos; 423 424 if (x0 == pos) return (x->data[pos] <= x->data[x2]) ? pos : x2; 424 425 if (x2 == pos) return (x->data[pos] <= x->data[x0]) ? pos : x0; … … 448 449 aubio_freqtomidi (smpl_t freq) 449 450 { 451 smpl_t midi; 450 452 if (freq < 2. || freq > 100000.) return 0.; // avoid nans and infs 451 453 /* log(freq/A-2)/log(2) */ 452 smpl_tmidi = freq / 6.875;454 midi = freq / 6.875; 453 455 midi = LOG (midi) / 0.69314718055995; 454 456 midi *= 12; … … 460 462 aubio_miditofreq (smpl_t midi) 461 463 { 464 smpl_t freq; 462 465 if (midi > 140.) return 0.; // avoid infs 463 smpl_tfreq = (midi + 3.) / 12.;466 freq = (midi + 3.) / 12.; 464 467 freq = EXP (freq * 0.69314718055995); 465 468 freq *= 6.875; -
src/onset/peakpicker.c
r89e9e71 rd4791e5 166 166 167 167 aubio_peakpicker_t * 168 new_aubio_peakpicker ( )168 new_aubio_peakpicker (void) 169 169 { 170 170 aubio_peakpicker_t *t = AUBIO_NEW (aubio_peakpicker_t); -
src/pitch/pitch.c
r89e9e71 rd4791e5 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
r89e9e71 rd4791e5 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
r89e9e71 rd4791e5 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/spectral/filterbank_mel.c
r89e9e71 rd4791e5 25 25 #include "cvec.h" 26 26 #include "spectral/filterbank.h" 27 #include "spectral/filterbank_mel.h" 27 28 #include "mathutils.h" 28 29 … … 34 35 fmat_t *filters = aubio_filterbank_get_coeffs (fb); 35 36 uint_t n_filters = filters->height, win_s = filters->length; 37 fvec_t *lower_freqs, *upper_freqs, *center_freqs; 38 fvec_t *triangle_heights, *fft_freqs; 36 39 37 40 uint_t fn; /* filter counter */ 38 41 uint_t bin; /* bin counter */ 42 43 smpl_t riseInc, downInc; 39 44 40 45 /* freqs define the bands of triangular overlapping windows. … … 56 61 57 62 /* convenience reference to lower/center/upper frequency for each triangle */ 58 fvec_t *lower_freqs = new_fvec (n_filters);59 fvec_t *upper_freqs = new_fvec (n_filters);60 fvec_t *center_freqs = new_fvec (n_filters);63 lower_freqs = new_fvec (n_filters); 64 upper_freqs = new_fvec (n_filters); 65 center_freqs = new_fvec (n_filters); 61 66 62 67 /* height of each triangle */ 63 fvec_t *triangle_heights = new_fvec (n_filters);68 triangle_heights = new_fvec (n_filters); 64 69 65 70 /* lookup table of each bin frequency in hz */ 66 f vec_t *fft_freqs = new_fvec (win_s);71 fft_freqs = new_fvec (win_s); 67 72 68 73 /* fill up the lower/center/upper */ … … 112 117 113 118 /* compute positive slope step size */ 114 smpl_triseInc =119 riseInc = 115 120 triangle_heights->data[fn] / 116 121 (center_freqs->data[fn] - lower_freqs->data[fn]); … … 128 133 129 134 /* compute negative slope step size */ 130 smpl_tdownInc =135 downInc = 131 136 triangle_heights->data[fn] / 132 137 (upper_freqs->data[fn] - center_freqs->data[fn]); … … 176 181 uint_t fn; /* filter counter */ 177 182 183 smpl_t lastlinearCF; 184 178 185 /* buffers to compute filter frequencies */ 179 186 fvec_t *freqs = new_fvec (n_filters + 2); … … 183 190 freqs->data[fn] = lowestFrequency + fn * linearSpacing; 184 191 } 185 smpl_tlastlinearCF = freqs->data[fn - 1];192 lastlinearCF = freqs->data[fn - 1]; 186 193 187 194 /* second step: fill all the log filter frequencies */ -
src/spectral/mfcc.c
r89e9e71 rd4791e5 52 52 /* allocate space for mfcc object */ 53 53 aubio_mfcc_t *mfcc = AUBIO_NEW (aubio_mfcc_t); 54 smpl_t scaling; 54 55 55 56 uint_t i, j; … … 71 72 /* compute DCT transform dct_coeffs[i][j] as 72 73 cos ( j * (i+.5) * PI / n_filters ) */ 73 s mpl_t scaling = 1. / SQRT (n_filters / 2.);74 scaling = 1. / SQRT (n_filters / 2.); 74 75 for (i = 0; i < n_filters; i++) { 75 76 for (j = 0; j < n_coefs; j++) { -
src/spectral/ooura_fft8g.c
r89e9e71 rd4791e5 1 // 2modifications made for aubio:1 // modifications made for aubio: 2 2 // - replace all 'double' with 'smpl_t' 3 3 // - include "aubio_priv.h" (for config.h and types.h) 4 // - add missing prototypes 4 5 5 6 #include "aubio_priv.h" 7 8 void cdft(int n, int isgn, smpl_t *a, int *ip, smpl_t *w); 9 void rdft(int n, int isgn, smpl_t *a, int *ip, smpl_t *w); 10 void ddct(int n, int isgn, smpl_t *a, int *ip, smpl_t *w); 11 void ddst(int n, int isgn, smpl_t *a, int *ip, smpl_t *w); 12 void dfct(int n, smpl_t *a, smpl_t *t, int *ip, smpl_t *w); 13 void dfst(int n, smpl_t *a, smpl_t *t, int *ip, smpl_t *w); 14 void makewt(int nw, int *ip, smpl_t *w); 15 void makect(int nc, int *ip, smpl_t *c); 16 void bitrv2(int n, int *ip, smpl_t *a); 17 void bitrv2conj(int n, int *ip, smpl_t *a); 18 void cftfsub(int n, smpl_t *a, smpl_t *w); 19 void cftbsub(int n, smpl_t *a, smpl_t *w); 20 void cft1st(int n, smpl_t *a, smpl_t *w); 21 void cftmdl(int n, int l, smpl_t *a, smpl_t *w); 22 void rftfsub(int n, smpl_t *a, int nc, smpl_t *c); 23 void rftbsub(int n, smpl_t *a, int nc, smpl_t *c); 24 void dctsub(int n, smpl_t *a, int nc, smpl_t *c); 25 void dstsub(int n, smpl_t *a, int nc, smpl_t *c); 6 26 7 27 /* -
src/spectral/phasevoc.c
r89e9e71 rd4791e5 120 120 const smpl_t * datanew, uint_t win_s, uint_t hop_s) 121 121 { 122 #if !HAVE_MEMCPY_HACKS 122 123 uint_t i; 123 124 for (i = 0; i < win_s - hop_s; i++) … … 127 128 for (i = 0; i < win_s - hop_s; i++) 128 129 dataold[i] = data[i + hop_s]; 130 #else 131 memcpy(data, dataold, (win_s - hop_s) * sizeof(smpl_t)); 132 data += win_s - hop_s; 133 memcpy(data, datanew, hop_s * sizeof(smpl_t)); 134 data -= win_s - hop_s; 135 data += hop_s; 136 memcpy(dataold, data, (win_s - hop_s) * sizeof(smpl_t)); 137 #endif 129 138 } 130 139 -
src/spectral/statistics.c
r89e9e71 rd4791e5 22 22 #include "cvec.h" 23 23 #include "spectral/specdesc.h" 24 25 void aubio_specdesc_centroid (aubio_specdesc_t * o, cvec_t * spec, 26 fvec_t * desc); 27 void aubio_specdesc_spread (aubio_specdesc_t * o, cvec_t * spec, 28 fvec_t * desc); 29 void aubio_specdesc_skewness (aubio_specdesc_t * o, cvec_t * spec, 30 fvec_t * desc); 31 void aubio_specdesc_kurtosis (aubio_specdesc_t * o, cvec_t * spec, 32 fvec_t * desc); 33 void aubio_specdesc_slope (aubio_specdesc_t * o, cvec_t * spec, 34 fvec_t * desc); 35 void aubio_specdesc_decrease (aubio_specdesc_t * o, cvec_t * spec, 36 fvec_t * desc); 37 void aubio_specdesc_rolloff (aubio_specdesc_t * o, cvec_t * spec, 38 fvec_t * desc); 39 40 41 smpl_t cvec_sum (cvec_t * s); 42 smpl_t cvec_mean (cvec_t * s); 43 smpl_t cvec_centroid (cvec_t * s); 44 smpl_t cvec_moment (cvec_t * s, uint_t moment); 24 45 25 46 smpl_t -
src/synth/wavetable.c
r89e9e71 rd4791e5 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
r89e9e71 rd4791e5 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/tempo/tempo.c
r89e9e71 rd4791e5 28 28 #include "mathutils.h" 29 29 #include "tempo/tempo.h" 30 31 // TODO implement get/set_delay 32 33 /** set current delay 34 35 \param o beat tracking object 36 37 \return current delay, in samples 38 39 */ 40 uint_t aubio_tempo_get_delay(aubio_tempo_t * o); 41 42 /** set current delay 43 44 \param o beat tracking object 45 \param delay delay to set tempo to, in samples 46 47 \return `0` if successful, non-zero otherwise 48 49 */ 50 uint_t aubio_tempo_set_delay(aubio_tempo_t * o, uint_t delay); 30 51 31 52 /* structure to store object state */ -
src/temporal/a_weighting.c
r89e9e71 rd4791e5 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/biquad.c
r89e9e71 rd4791e5 23 23 #include "lvec.h" 24 24 #include "temporal/filter.h" 25 #include "temporal/biquad.h" 25 26 26 27 uint_t -
src/temporal/c_weighting.c
r89e9e71 rd4791e5 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 ) { -
tests/src/onset/test-peakpicker.c
r89e9e71 rd4791e5 3 3 #include <aubio.h> 4 4 5 int main ( )5 int main (void) 6 6 { 7 7 uint_t win_s = 1024; // window size -
tests/src/pitch/test-pitch.c
r89e9e71 rd4791e5 1 1 #include <aubio.h> 2 2 3 int main ( )3 int main (void) 4 4 { 5 5 // 1. allocate some memory -
tests/src/pitch/test-pitchfcomb.c
r89e9e71 rd4791e5 6 6 #include <aubio.h> 7 7 8 int main ( )8 int main (void) 9 9 { 10 10 uint_t i = 0; -
tests/src/pitch/test-pitchmcomb.c
r89e9e71 rd4791e5 6 6 #include <aubio.h> 7 7 8 int main ( )8 int main (void) 9 9 { 10 10 uint_t n = 10; // compute n times -
tests/src/pitch/test-pitchschmitt.c
r89e9e71 rd4791e5 6 6 #include <aubio.h> 7 7 8 int main ( )8 int main (void) 9 9 { 10 10 uint_t n = 10; // compute n times -
tests/src/pitch/test-pitchspecacf.c
r89e9e71 rd4791e5 6 6 #include <aubio.h> 7 7 8 int main ( )8 int main (void) 9 9 { 10 10 uint_t n = 10; // compute n times -
tests/src/pitch/test-pitchyin.c
r89e9e71 rd4791e5 6 6 #include <aubio.h> 7 7 8 int main ( )8 int main (void) 9 9 { 10 10 uint_t n = 10; // compute n times -
tests/src/pitch/test-pitchyinfft.c
r89e9e71 rd4791e5 6 6 #include <aubio.h> 7 7 8 int main ( )8 int main (void) 9 9 { 10 10 uint_t n = 10; // compute n times -
tests/src/spectral/test-fft.c
r89e9e71 rd4791e5 1 1 #include <aubio.h> 2 2 3 int main ( )3 int main (void) 4 4 { 5 5 uint_t win_s = 8; // window size -
tests/src/spectral/test-filterbank.c
r89e9e71 rd4791e5 1 1 #include <aubio.h> 2 2 3 int main ( )3 int main (void) 4 4 { 5 5 uint_t win_s = 1024; // window size -
tests/src/spectral/test-filterbank_mel.c
r89e9e71 rd4791e5 1 1 #include <aubio.h> 2 2 3 int main ( )3 int main (void) 4 4 { 5 5 uint_t samplerate = 16000; // samplerate of signal to filter -
tests/src/spectral/test-mfcc.c
r89e9e71 rd4791e5 1 1 #include <aubio.h> 2 2 3 int main ( )3 int main (void) 4 4 { 5 5 uint_t win_s = 512; // fft size -
tests/src/spectral/test-phasevoc.c
r89e9e71 rd4791e5 1 1 #include <aubio.h> 2 2 3 int main ( )3 int main (void) 4 4 { 5 5 uint_t n = 6; // compute n times -
tests/src/spectral/test-specdesc.c
r89e9e71 rd4791e5 1 1 #include <aubio.h> 2 2 3 int main ( )3 int main (void) 4 4 { 5 5 uint_t win_s = 1024; // window size -
tests/src/spectral/test-tss.c
r89e9e71 rd4791e5 1 1 #include <aubio.h> 2 2 3 int main ( )3 int main (void) 4 4 { 5 5 uint_t n = 10; // compute n times -
tests/src/tempo/test-beattracking.c
r89e9e71 rd4791e5 4 4 #include <stdio.h> 5 5 6 int main ( )6 int main (void) 7 7 { 8 8 uint_t i = 0; -
tests/src/temporal/test-a_weighting.c
r89e9e71 rd4791e5 1 1 #include <aubio.h> 2 2 3 int main ( )3 int main (void) 4 4 { 5 5 -
tests/src/temporal/test-biquad.c
r89e9e71 rd4791e5 1 1 #include <aubio.h> 2 2 3 int main ( )3 int main (void) 4 4 { 5 5 uint_t win_s = 64; // window size -
tests/src/temporal/test-c_weighting.c
r89e9e71 rd4791e5 1 1 #include <aubio.h> 2 2 3 int main ( )3 int main (void) 4 4 { 5 5 aubio_filter_t * f; -
tests/src/temporal/test-filter.c
r89e9e71 rd4791e5 1 1 #include <aubio.h> 2 2 3 int main ( )3 int main (void) 4 4 { 5 5 uint_t win_s = 16; // window size -
tests/src/temporal/test-resampler.c
r89e9e71 rd4791e5 1 1 #include <aubio.h> 2 2 3 int main ( )3 int main (void) 4 4 { 5 5 uint_t win_s = 1024; // window size -
tests/src/test-cvec.c
r89e9e71 rd4791e5 2 2 #include "utils_tests.h" 3 3 4 int main ( )4 int main (void) 5 5 { 6 6 uint_t i, window_size = 16; // window size -
tests/src/test-delnull.c
r89e9e71 rd4791e5 5 5 // Programs that call these functions should check for null pointers. 6 6 7 int main ( )7 int main (void) 8 8 { 9 9 del_fvec(NULL); -
tests/src/test-fmat.c
r89e9e71 rd4791e5 5 5 // and j the column. 6 6 7 int main ( )7 int main (void) 8 8 { 9 9 uint_t height = 3, length = 9, i, j; -
tests/src/test-fvec.c
r89e9e71 rd4791e5 2 2 #include <assert.h> 3 3 4 int main ( )4 int main (void) 5 5 { 6 6 uint_t vec_size = 10, i; -
tests/src/test-lvec.c
r89e9e71 rd4791e5 1 1 #include <aubio.h> 2 #include "utils_tests.h" 2 3 3 int main ()4 int main (void) 4 5 { 5 uint_t win_s = 1024; // window size6 uint_t win_s = 32; // window size 6 7 lvec_t * sp = new_lvec (win_s); // input buffer 8 lvec_set_sample (sp, 2./3., 0); 9 PRINT_MSG("%lf\n", lvec_get_sample (sp, 0)); 10 lvec_print (sp); 11 lvec_ones (sp); 12 lvec_print (sp); 13 lvec_set_all (sp, 3./5.); 14 lvec_print (sp); 7 15 del_lvec(sp); 8 16 return 0; -
tests/src/test-mathutils-window.c
r89e9e71 rd4791e5 3 3 #include <stdio.h> 4 4 5 int main ( )5 int main (void) 6 6 { 7 7 uint_t length = 0; -
tests/src/test-mathutils.c
r89e9e71 rd4791e5 4 4 #include <aubio.h> 5 5 6 int test_next_power_of_two() 6 int test_next_power_of_two (void); 7 int test_miditofreq (void); 8 int test_freqtomidi (void); 9 int test_aubio_window (void); 10 11 int test_next_power_of_two (void) 7 12 { 8 13 uint_t a, b; … … 25 30 } 26 31 27 int test_miditofreq ()32 int test_miditofreq (void) 28 33 { 29 34 smpl_t a, b; … … 56 61 } 57 62 58 int test_freqtomidi ()63 int test_freqtomidi (void) 59 64 { 60 65 smpl_t midi, freq; … … 88 93 } 89 94 90 int test_aubio_window ()95 int test_aubio_window (void) 91 96 { 92 97 uint_t window_size = 16; … … 108 113 } 109 114 110 int main ( )115 int main (void) 111 116 { 112 117 test_next_power_of_two(); -
tests/src/utils/test-hist.c
r89e9e71 rd4791e5 3 3 #include <aubio.h> 4 4 5 int main ( )5 int main (void) 6 6 { 7 7 uint_t length; -
tests/src/utils/test-parameter.c
r89e9e71 rd4791e5 1 1 #include <aubio.h> 2 2 #include "utils_tests.h" 3 4 void get_some_steps ( aubio_parameter_t * param ); 3 5 4 6 void get_some_steps ( aubio_parameter_t * param ) … … 21 23 } 22 24 23 int main ( )25 int main (void) 24 26 { 25 27 smpl_t max_value = 100.; -
tests/src/utils/test-scale.c
r89e9e71 rd4791e5 3 3 #include <aubio.h> 4 4 5 int main ( )5 int main (void) 6 6 { 7 7 uint_t n = 0; -
tests/utils_tests.h
r89e9e71 rd4791e5 27 27 #endif 28 28 29 void utils_init_random () { 29 void utils_init_random (void); 30 31 void utils_init_random (void) { 30 32 time_t now = time(0); 31 33 struct tm *tm_struct = localtime(&now); -
wscript
r89e9e71 rd4791e5 86 86 ctx.load('gnu_dirs') 87 87 88 ctx.env.CFLAGS += ['-g', '-Wall', '-Wextra']89 90 88 target_platform = Options.platform 91 89 if ctx.options.target_platform: 92 90 target_platform = ctx.options.target_platform 93 91 ctx.env['DEST_OS'] = target_platform 92 93 if 'CL.exe' not in ctx.env.CC[0]: 94 ctx.env.CFLAGS += ['-g', '-Wall', '-Wextra'] 95 else: 96 ctx.env.CFLAGS += ['-Wall'] 94 97 95 98 if target_platform not in ['win32', 'win64']: … … 152 155 if ctx.check_cc(fragment = check_c99_varargs, 153 156 type='cstlib', 154 msg = 'Checking for C99 __VA_ARGS__ macro'): 157 msg = 'Checking for C99 __VA_ARGS__ macro', 158 mandatory = False): 155 159 ctx.define('HAVE_C99_VARARGS_MACROS', 1) 156 160
Note: See TracChangeset
for help on using the changeset viewer.