Changeset d4791e5


Ignore:
Timestamp:
Jan 3, 2014, 12:47:22 AM (11 years ago)
Author:
Paul Brossier <piem@piem.org>
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.
Message:

Merge branch 'develop' of aubio.org:/git/aubio/aubio into develop

Files:
66 edited

Legend:

Unmodified
Added
Removed
  • examples/aubiomfcc.c

    r89e9e71 rd4791e5  
    3030uint_t n_coefs = 13;
    3131
    32 static void
    33 process_block(fvec_t *ibuf, fvec_t *obuf) {
     32void process_block (fvec_t *ibuf, fvec_t *obuf)
     33{
    3434  fvec_zeros(obuf);
    3535  //compute mag spectrum
     
    3939}
    4040
    41 static void process_print (void) {
     41void process_print (void)
     42{
    4243  /* output times in seconds and extracted mfccs */
    4344  outmsg("%f\t",blocks*hop_size/(float)samplerate);
  • examples/aubionotes.c

    r89e9e71 rd4791e5  
    4646uint_t get_note (fvec_t * note_buffer, fvec_t * note_buffer2);
    4747
    48 static void
    49 process_block(fvec_t *ibuf, fvec_t *obuf) {
     48void process_block (fvec_t *ibuf, fvec_t *obuf)
     49{
     50  smpl_t new_pitch, curlevel;
    5051  fvec_zeros(obuf);
    5152  aubio_onset_do(o, ibuf, onset);
    5253
    5354  aubio_pitch_do (pitch, ibuf, pitch_obuf);
    54   smpl_t new_pitch = fvec_get_sample(pitch_obuf, 0);
     55  new_pitch = fvec_get_sample(pitch_obuf, 0);
    5556  if(median){
    5657    note_append(note_buffer, new_pitch);
     
    5859
    5960  /* curlevel is negatif or 1 if silence */
    60   smpl_t curlevel = aubio_level_detection(ibuf, silence_threshold);
     61  curlevel = aubio_level_detection(ibuf, silence_threshold);
    6162  if (fvec_get_sample(onset, 0)) {
    6263    /* test for silence */
     
    9596}
    9697
    97 static void
    98 process_print (void) {
     98void process_print (void)
     99{
    99100  //if (verbose) outmsg("%f\n",pitch_obuf->data[0]);
    100101}
  • examples/aubioonset.c

    r89e9e71 rd4791e5  
    3030smpl_t is_onset;
    3131
    32 void
    33 process_block(fvec_t *ibuf, fvec_t *obuf) {
    34   fvec_zeros(obuf);
     32void process_block(fvec_t *ibuf, fvec_t *obuf)
     33{
    3534  aubio_onset_do (o, ibuf, onset);
    3635  is_onset = fvec_get_sample(onset, 0);
     36  if ( !usejack && ! sink_uri ) return;
     37  fvec_zeros(obuf);
    3738  if ( is_onset ) {
    3839    aubio_wavetable_play ( wavetable );
     
    4647}
    4748
    48 void
    49 process_print (void)
     49void process_print (void)
    5050{
    5151  if ( is_onset ) {
  • examples/aubiopitch.c

    r89e9e71 rd4791e5  
    2929fvec_t *pitch;
    3030
    31 void
    32 process_block(fvec_t * ibuf, fvec_t * obuf) {
     31void 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;
    3336  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);
    3638  aubio_wavetable_set_amp ( wavetable, aubio_level_lin (ibuf) );
    3739  aubio_wavetable_set_freq ( wavetable, freq );
    38 
    3940  if (mix_input)
    4041    aubio_wavetable_do (wavetable, ibuf, obuf);
     
    4344}
    4445
    45 void
    46 process_print (void) {
     46void process_print (void)
     47{
    4748  smpl_t pitch_found = fvec_get_sample(pitch, 0);
    4849  outmsg("%f %f\n",(blocks)
  • examples/aubioquiet.c

    r89e9e71 rd4791e5  
    3737}
    3838
    39 static void process_print (void) {
     39void process_print (void) {
    4040  int curblocks = (blocks - 4) > 0 ? blocks - 4 : 0;
    4141  if (issilence == -1) {
  • examples/aubiotrack.c

    r89e9e71 rd4791e5  
    3636  if (silence_threshold != -90.)
    3737    is_silence = aubio_silence_detection(ibuf, silence_threshold);
     38  if ( !usejack && ! sink_uri ) return;
    3839  fvec_zeros (obuf);
    3940  if ( is_beat && !is_silence ) {
  • examples/parse_args.h

    r89e9e71 rd4791e5  
    4848extern void examples_common_process (aubio_process_func_t process_func,
    4949    aubio_print_func_t print);
     50int parse_args (int argc, char **argv);
    5051
    5152// internal stuff
     
    5758const char *prog_name;
    5859
    59 void
    60 usage (FILE * stream, int exit_code)
     60void usage (FILE * stream, int exit_code);
     61
     62void usage (FILE * stream, int exit_code)
    6163{
    6264  fprintf (stream, "usage: %s [ options ] \n", prog_name);
  • examples/utils.c

    r89e9e71 rd4791e5  
    7373#endif
    7474
    75 void
    76 examples_common_init (int argc, char **argv)
     75void examples_common_init (int argc, char **argv);
     76void examples_common_del (void);
     77void examples_common_process (aubio_process_func_t process_func,
     78    aubio_print_func_t print);
     79
     80void examples_common_init (int argc, char **argv)
    7781{
    7882
     
    116120}
    117121
    118 void
    119 examples_common_del (void)
     122void examples_common_del (void)
    120123{
    121124  del_fvec (ibuf);
     
    126129}
    127130
    128 void
    129 examples_common_process (aubio_process_func_t process_func,
     131void examples_common_process (aubio_process_func_t process_func,
    130132    aubio_print_func_t print)
    131133{
     
    146148
    147149  } else {
    148     /* phasevoc */
     150
     151    uint_t total_read = 0;
    149152    blocks = 0;
    150     uint_t total_read = 0;
    151153
    152154    do {
  • examples/utils.h

    r89e9e71 rd4791e5  
    4242#define debug(...)                fprintf (stderr, format , **args)
    4343#else
    44 #define debug(...)                ()
     44#define debug(...)
    4545#endif
    4646#define verbmsg(format, args...)  if (verbose) fprintf(stderr, format , ##args)
     
    5454/** common process function */
    5555typedef int (*aubio_process_func_t) (fvec_t * input, fvec_t * output);
     56
     57void process_block (fvec_t *ibuf, fvec_t *obuf);
     58void process_print (void);
  • src/aubio_priv.h

    r89e9e71 rd4791e5  
    3434 */
    3535
    36 #if 1 //HAVE_CONFIG_H
    3736#include "config.h"
    38 #endif
    3937
    4038#if HAVE_STDLIB_H
     
    4745
    4846/* must be included before fftw3.h */
    49 #if HAVE_COMPLEX_H
     47#ifdef HAVE_COMPLEX_H
    5048#include <complex.h>
    5149#endif
    5250
    53 #if HAVE_FFTW3 || HAVE_FFTW3F
     51#if defined(HAVE_FFTW3) || defined(HAVE_FFTW3F)
    5452#include <fftw3.h>
    5553#endif
    5654
    57 #if HAVE_MATH_H
     55#ifdef HAVE_MATH_H
    5856#include <math.h>
    5957#endif
    6058
    61 #if HAVE_STRING_H
     59#ifdef HAVE_STRING_H
    6260#include <string.h>
    6361#endif
    6462
    65 #if HAVE_LIMITS_H
     63#ifdef HAVE_LIMITS_H
    6664#include <limits.h> // for CHAR_BIT, in C99 standard
    6765#endif
  • src/cvec.c

    r89e9e71 rd4791e5  
    2323
    2424cvec_t * new_cvec( uint_t length) {
     25  cvec_t * s;
    2526  if ((sint_t)length <= 0) {
    2627    return NULL;
    2728  }
    28   cvec_t * s = AUBIO_NEW(cvec_t);
     29  s = AUBIO_NEW(cvec_t);
    2930  s->length = length/2 + 1;
    3031  s->norm = AUBIO_ARRAY(smpl_t,s->length);
  • src/fmat.c

    r89e9e71 rd4791e5  
    2323
    2424fmat_t * new_fmat (uint_t height, uint_t length) {
     25  fmat_t * s;
     26  uint_t i,j;
    2527  if ((sint_t)length <= 0 || (sint_t)height <= 0 ) {
    2628    return NULL;
    2729  }
    28   fmat_t * s = AUBIO_NEW(fmat_t);
    29   uint_t i,j;
     30  s = AUBIO_NEW(fmat_t);
    3031  s->height = height;
    3132  s->length = length;
     
    127128
    128129void fmat_copy(fmat_t *s, fmat_t *t) {
     130  uint_t i;
     131#if !HAVE_MEMCPY_HACKS
     132  uint_t i,j;
     133#endif
    129134  if (s->height != t->height) {
    130135    AUBIO_ERR("trying to copy %d rows to %d rows \n",
     
    138143  }
    139144#if HAVE_MEMCPY_HACKS
    140   uint_t i;
    141145  for (i=0; i< s->height; i++) {
    142146    memcpy(t->data[i], s->data[i], t->length * sizeof(smpl_t));
    143147  }
    144148#else
    145   uint_t i,j;
    146149  for (i=0; i< t->height; i++) {
    147150    for (j=0; j< t->length; j++) {
  • src/fvec.c

    r89e9e71 rd4791e5  
    2323
    2424fvec_t * new_fvec( uint_t length) {
     25  fvec_t * s;
    2526  if ((sint_t)length <= 0) {
    2627    return NULL;
    2728  }
    28   fvec_t * s = AUBIO_NEW(fvec_t);
     29  s = AUBIO_NEW(fvec_t);
    2930  s->length = length;
    3031  s->data = AUBIO_ARRAY(smpl_t, s->length);
  • src/io/sink_sndfile.c

    r89e9e71 rd4791e5  
    4747aubio_sink_sndfile_t * new_aubio_sink_sndfile(char_t * path, uint_t samplerate) {
    4848  aubio_sink_sndfile_t * s = AUBIO_NEW(aubio_sink_sndfile_t);
     49  SF_INFO sfinfo;
    4950
    5051  if (path == NULL) {
     
    5960
    6061  /* set output format */
    61   SF_INFO sfinfo;
    6262  AUBIO_MEMSET(&sfinfo, 0, sizeof (sfinfo));
    6363  sfinfo.samplerate = s->samplerate;
     
    9292  int nsamples = channels*write;
    9393  smpl_t *pwrite;
     94  sf_count_t written_frames;
    9495
    9596  if (write > s->max_size) {
     
    107108  }
    108109
    109   sf_count_t written_frames = sf_write_float (s->handle, s->scratch_data, nsamples);
     110  written_frames = sf_write_float (s->handle, s->scratch_data, nsamples);
    110111  if (written_frames/channels != write) {
    111112    AUBIO_WRN("trying to write %d frames to %s, but only %d could be written",
  • src/io/source_avcodec.c

    r89e9e71 rd4791e5  
    6262// hack to create or re-create the context the first time _do or _do_multi is called
    6363void aubio_source_avcodec_reset_resampler(aubio_source_avcodec_t * s, uint_t multi);
     64void aubio_source_avcodec_readframe(aubio_source_avcodec_t *s, uint_t * read_samples);
    6465
    6566aubio_source_avcodec_t * new_aubio_source_avcodec(char_t * path, uint_t samplerate, uint_t hop_size) {
     
    279280        (uint8_t **)avFrame->data, in_linesize, in_samples);
    280281  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);
    282283    goto beach;
    283284  }
  • src/io/source_sndfile.c

    r89e9e71 rd4791e5  
    6464aubio_source_sndfile_t * new_aubio_source_sndfile(char_t * path, uint_t samplerate, uint_t hop_size) {
    6565  aubio_source_sndfile_t * s = AUBIO_NEW(aubio_source_sndfile_t);
     66  SF_INFO sfinfo;
    6667
    6768  if (path == NULL) {
     
    8384
    8485  // try opening the file, getting the info in sfinfo
    85   SF_INFO sfinfo;
    8686  AUBIO_MEMSET(&sfinfo, 0, sizeof (sfinfo));
    8787  s->handle = sf_open (s->path, SFM_READ, &sfinfo);
  • src/lvec.c

    r89e9e71 rd4791e5  
    2323
    2424lvec_t * new_lvec( uint_t length) {
     25  lvec_t * s;
    2526  if ((sint_t)length <= 0) {
    2627    return NULL;
    2728  }
    28   lvec_t * s = AUBIO_NEW(lvec_t);
     29  s = AUBIO_NEW(lvec_t);
    2930  s->length = length;
    3031  s->data = AUBIO_ARRAY(lsmp_t, s->length);
     
    3738}
    3839
    39 void lvec_write_sample(lvec_t *s, lsmp_t data, uint_t position) {
     40void lvec_set_sample(lvec_t *s, lsmp_t data, uint_t position) {
    4041  s->data[position] = data;
    4142}
     43
    4244lsmp_t lvec_get_sample(lvec_t *s, uint_t position) {
    4345  return s->data[position];
  • src/mathutils.c

    r89e9e71 rd4791e5  
    5050{
    5151  fvec_t * win = new_fvec (length);
     52  uint_t err;
    5253  if (win == NULL) {
    5354    return NULL;
    5455  }
    55   uint_t err = fvec_set_window (win, window_type);
     56  err = fvec_set_window (win, window_type);
    5657  if (err != 0) {
    5758    del_fvec(win);
     
    417418
    418419smpl_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;
    420421  if (pos == 0 || pos == x->length - 1) return pos;
    421   uint_t x0 = (pos < 1) ? pos : pos - 1;
    422   uint_t x2 = (pos + 1 < x->length) ? pos + 1 : pos;
     422  x0 = (pos < 1) ? pos : pos - 1;
     423  x2 = (pos + 1 < x->length) ? pos + 1 : pos;
    423424  if (x0 == pos) return (x->data[pos] <= x->data[x2]) ? pos : x2;
    424425  if (x2 == pos) return (x->data[pos] <= x->data[x0]) ? pos : x0;
     
    448449aubio_freqtomidi (smpl_t freq)
    449450{
     451  smpl_t midi;
    450452  if (freq < 2. || freq > 100000.) return 0.; // avoid nans and infs
    451453  /* log(freq/A-2)/log(2) */
    452   smpl_t midi = freq / 6.875;
     454  midi = freq / 6.875;
    453455  midi = LOG (midi) / 0.69314718055995;
    454456  midi *= 12;
     
    460462aubio_miditofreq (smpl_t midi)
    461463{
     464  smpl_t freq;
    462465  if (midi > 140.) return 0.; // avoid infs
    463   smpl_t freq = (midi + 3.) / 12.;
     466  freq = (midi + 3.) / 12.;
    464467  freq = EXP (freq * 0.69314718055995);
    465468  freq *= 6.875;
  • src/onset/peakpicker.c

    r89e9e71 rd4791e5  
    166166
    167167aubio_peakpicker_t *
    168 new_aubio_peakpicker ()
     168new_aubio_peakpicker (void)
    169169{
    170170  aubio_peakpicker_t *t = AUBIO_NEW (aubio_peakpicker_t);
  • src/pitch/pitch.c

    r89e9e71 rd4791e5  
    367367aubio_pitch_do_specacf (aubio_pitch_t * p, fvec_t * ibuf, fvec_t * out)
    368368{
     369  smpl_t pitch = 0., period;
    369370  aubio_pitch_slideblock (p, ibuf);
    370371  aubio_pitchspecacf_do (p->p_object, p->buf, out);
    371372  //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];
    373374  if (period > 0) {
    374375    pitch = p->samplerate / period;
  • src/pitch/pitchspecacf.c

    r89e9e71 rd4791e5  
    5757aubio_pitchspecacf_do (aubio_pitchspecacf_t * p, fvec_t * input, fvec_t * output)
    5858{
    59   uint_t l;
     59  uint_t l, tau;
    6060  fvec_t *fftout = p->fftout;
    6161  // window the input
     
    7575  }
    7676  // get the minimum
    77   uint_t tau = fvec_min_elem (p->acf);
     77  tau = fvec_min_elem (p->acf);
    7878  // get the interpolated minimum
    7979  output->data[0] = fvec_quadratic_peak_pos (p->acf, tau) * 2.;
  • src/pitch/pitchyinfft.c

    r89e9e71 rd4791e5  
    5858new_aubio_pitchyinfft (uint_t samplerate, uint_t bufsize)
    5959{
     60  uint_t i = 0, j = 1;
     61  smpl_t freq = 0, a0 = 0, a1 = 0, f0 = 0, f1 = 0;
    6062  aubio_pitchyinfft_t *p = AUBIO_NEW (aubio_pitchyinfft_t);
    6163  p->winput = new_fvec (bufsize);
     
    6769  p->win = new_aubio_window ("hanningz", bufsize);
    6870  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;
    7171  for (i = 0; i < p->weight->length; i++) {
    7272    freq = (smpl_t) i / (smpl_t) bufsize *(smpl_t) samplerate;
  • src/spectral/filterbank_mel.c

    r89e9e71 rd4791e5  
    2525#include "cvec.h"
    2626#include "spectral/filterbank.h"
     27#include "spectral/filterbank_mel.h"
    2728#include "mathutils.h"
    2829
     
    3435  fmat_t *filters = aubio_filterbank_get_coeffs (fb);
    3536  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;
    3639
    3740  uint_t fn;                    /* filter counter */
    3841  uint_t bin;                   /* bin counter */
     42
     43  smpl_t riseInc, downInc;
    3944
    4045  /* freqs define the bands of triangular overlapping windows.
     
    5661
    5762  /* 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);
    6166
    6267  /* height of each triangle */
    63   fvec_t *triangle_heights = new_fvec (n_filters);
     68  triangle_heights = new_fvec (n_filters);
    6469
    6570  /* lookup table of each bin frequency in hz */
    66   fvec_t *fft_freqs = new_fvec (win_s);
     71  fft_freqs = new_fvec (win_s);
    6772
    6873  /* fill up the lower/center/upper */
     
    112117
    113118    /* compute positive slope step size */
    114     smpl_t riseInc =
     119    riseInc =
    115120        triangle_heights->data[fn] /
    116121        (center_freqs->data[fn] - lower_freqs->data[fn]);
     
    128133
    129134    /* compute negative slope step size */
    130     smpl_t downInc =
     135    downInc =
    131136        triangle_heights->data[fn] /
    132137        (upper_freqs->data[fn] - center_freqs->data[fn]);
     
    176181  uint_t fn;                    /* filter counter */
    177182
     183  smpl_t lastlinearCF;
     184
    178185  /* buffers to compute filter frequencies */
    179186  fvec_t *freqs = new_fvec (n_filters + 2);
     
    183190    freqs->data[fn] = lowestFrequency + fn * linearSpacing;
    184191  }
    185   smpl_t lastlinearCF = freqs->data[fn - 1];
     192  lastlinearCF = freqs->data[fn - 1];
    186193
    187194  /* second step: fill all the log filter frequencies */
  • src/spectral/mfcc.c

    r89e9e71 rd4791e5  
    5252  /* allocate space for mfcc object */
    5353  aubio_mfcc_t *mfcc = AUBIO_NEW (aubio_mfcc_t);
     54  smpl_t scaling;
    5455
    5556  uint_t i, j;
     
    7172  /* compute DCT transform dct_coeffs[i][j] as
    7273     cos ( j * (i+.5) * PI / n_filters ) */
    73   smpl_t scaling = 1. / SQRT (n_filters / 2.);
     74  scaling = 1. / SQRT (n_filters / 2.);
    7475  for (i = 0; i < n_filters; i++) {
    7576    for (j = 0; j < n_coefs; j++) {
  • src/spectral/ooura_fft8g.c

    r89e9e71 rd4791e5  
    1 // 2 modifications made for aubio:
     1// modifications made for aubio:
    22//  - replace all 'double' with 'smpl_t'
    33//  - include "aubio_priv.h" (for config.h and types.h)
     4//  - add missing prototypes
    45
    56#include "aubio_priv.h"
     7
     8void cdft(int n, int isgn, smpl_t *a, int *ip, smpl_t *w);
     9void rdft(int n, int isgn, smpl_t *a, int *ip, smpl_t *w);
     10void ddct(int n, int isgn, smpl_t *a, int *ip, smpl_t *w);
     11void ddst(int n, int isgn, smpl_t *a, int *ip, smpl_t *w);
     12void dfct(int n, smpl_t *a, smpl_t *t, int *ip, smpl_t *w);
     13void dfst(int n, smpl_t *a, smpl_t *t, int *ip, smpl_t *w);
     14void makewt(int nw, int *ip, smpl_t *w);
     15void makect(int nc, int *ip, smpl_t *c);
     16void bitrv2(int n, int *ip, smpl_t *a);
     17void bitrv2conj(int n, int *ip, smpl_t *a);
     18void cftfsub(int n, smpl_t *a, smpl_t *w);
     19void cftbsub(int n, smpl_t *a, smpl_t *w);
     20void cft1st(int n, smpl_t *a, smpl_t *w);
     21void cftmdl(int n, int l, smpl_t *a, smpl_t *w);
     22void rftfsub(int n, smpl_t *a, int nc, smpl_t *c);
     23void rftbsub(int n, smpl_t *a, int nc, smpl_t *c);
     24void dctsub(int n, smpl_t *a, int nc, smpl_t *c);
     25void dstsub(int n, smpl_t *a, int nc, smpl_t *c);
    626
    727/*
  • src/spectral/phasevoc.c

    r89e9e71 rd4791e5  
    120120    const smpl_t * datanew, uint_t win_s, uint_t hop_s)
    121121{
     122#if !HAVE_MEMCPY_HACKS
    122123  uint_t i;
    123124  for (i = 0; i < win_s - hop_s; i++)
     
    127128  for (i = 0; i < win_s - hop_s; i++)
    128129    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
    129138}
    130139
  • src/spectral/statistics.c

    r89e9e71 rd4791e5  
    2222#include "cvec.h"
    2323#include "spectral/specdesc.h"
     24
     25void aubio_specdesc_centroid (aubio_specdesc_t * o, cvec_t * spec,
     26    fvec_t * desc);
     27void aubio_specdesc_spread (aubio_specdesc_t * o, cvec_t * spec,
     28    fvec_t * desc);
     29void aubio_specdesc_skewness (aubio_specdesc_t * o, cvec_t * spec,
     30    fvec_t * desc);
     31void aubio_specdesc_kurtosis (aubio_specdesc_t * o, cvec_t * spec,
     32    fvec_t * desc);
     33void aubio_specdesc_slope (aubio_specdesc_t * o, cvec_t * spec,
     34    fvec_t * desc);
     35void aubio_specdesc_decrease (aubio_specdesc_t * o, cvec_t * spec,
     36    fvec_t * desc);
     37void aubio_specdesc_rolloff (aubio_specdesc_t * o, cvec_t * spec,
     38    fvec_t * desc);
     39
     40
     41smpl_t cvec_sum (cvec_t * s);
     42smpl_t cvec_mean (cvec_t * s);
     43smpl_t cvec_centroid (cvec_t * s);
     44smpl_t cvec_moment (cvec_t * s, uint_t moment);
    2445
    2546smpl_t
  • src/synth/wavetable.c

    r89e9e71 rd4791e5  
    4343aubio_wavetable_t *new_aubio_wavetable(uint_t samplerate, uint_t blocksize)
    4444{
     45  uint_t i = 0;
    4546  aubio_wavetable_t *s = AUBIO_NEW(aubio_wavetable_t);
    4647  if ((sint_t)samplerate <= 0) {
     
    4849    goto beach;
    4950  }
    50   uint_t i = 0;
    5151  s->samplerate = samplerate;
    5252  s->blocksize = blocksize;
     
    115115    for (j = 0; j < output->length; j++) {
    116116      smpl_t inc = aubio_parameter_get_next_value( s->freq );
     117      smpl_t amp = aubio_parameter_get_next_value ( s->amp );
    117118      inc *= (smpl_t)(s->wavetable_length) / (smpl_t) (s->samplerate);
    118119      pos += inc;
     
    120121        pos -= s->wavetable_length;
    121122      }
    122       smpl_t amp = aubio_parameter_get_next_value ( s->amp );
    123123      for (i = 0; i < output->height; i++) {
    124124        output->data[i][j] = amp * interp_2(s->wavetable, pos);
  • src/tempo/beattracking.c

    r89e9e71 rd4791e5  
    6262  aubio_beattracking_t *p = AUBIO_NEW (aubio_beattracking_t);
    6363  uint_t i = 0;
    64   p->hop_size = hop_size;
    65   p->samplerate = samplerate;
    6664  /* default value for rayleigh weighting - sets preferred tempo to 120bpm */
    6765  smpl_t rayparam = 60. * samplerate / 120. / hop_size;
     
    7371  uint_t step = winlen / 4;     /* 1.5 seconds */
    7472
     73  p->hop_size = hop_size;
     74  p->samplerate = samplerate;
    7575  p->lastbeat = 0;
    7676  p->counter = 0;
  • src/tempo/tempo.c

    r89e9e71 rd4791e5  
    2828#include "mathutils.h"
    2929#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 */
     40uint_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 */
     50uint_t aubio_tempo_set_delay(aubio_tempo_t * o, uint_t delay);
    3051
    3152/* structure to store object state */
  • src/temporal/a_weighting.c

    r89e9e71 rd4791e5  
    2929aubio_filter_set_a_weighting (aubio_filter_t * f, uint_t samplerate)
    3030{
     31  uint_t order; lsmp_t *a, *b; lvec_t *as, *bs;
    3132  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_t order = 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);
    3637
    3738  if (order != 7) {
  • src/temporal/biquad.c

    r89e9e71 rd4791e5  
    2323#include "lvec.h"
    2424#include "temporal/filter.h"
     25#include "temporal/biquad.h"
    2526
    2627uint_t
  • src/temporal/c_weighting.c

    r89e9e71 rd4791e5  
    2929aubio_filter_set_c_weighting (aubio_filter_t * f, uint_t samplerate)
    3030{
     31  uint_t order; lsmp_t *a, *b; lvec_t *as, *bs;
    3132  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_t order = 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);
    3637
    3738  if ( order != 5 ) {
  • tests/src/onset/test-peakpicker.c

    r89e9e71 rd4791e5  
    33#include <aubio.h>
    44
    5 int main ()
     5int main (void)
    66{
    77  uint_t win_s = 1024; // window size
  • tests/src/pitch/test-pitch.c

    r89e9e71 rd4791e5  
    11#include <aubio.h>
    22
    3 int main ()
     3int main (void)
    44{
    55  // 1. allocate some memory
  • tests/src/pitch/test-pitchfcomb.c

    r89e9e71 rd4791e5  
    66#include <aubio.h>
    77
    8 int main ()
     8int main (void)
    99{
    1010  uint_t i = 0;
  • tests/src/pitch/test-pitchmcomb.c

    r89e9e71 rd4791e5  
    66#include <aubio.h>
    77
    8 int main ()
     8int main (void)
    99{
    1010  uint_t n = 10; // compute n times
  • tests/src/pitch/test-pitchschmitt.c

    r89e9e71 rd4791e5  
    66#include <aubio.h>
    77
    8 int main ()
     8int main (void)
    99{
    1010  uint_t n = 10; // compute n times
  • tests/src/pitch/test-pitchspecacf.c

    r89e9e71 rd4791e5  
    66#include <aubio.h>
    77
    8 int main ()
     8int main (void)
    99{
    1010  uint_t n = 10; // compute n times
  • tests/src/pitch/test-pitchyin.c

    r89e9e71 rd4791e5  
    66#include <aubio.h>
    77
    8 int main ()
     8int main (void)
    99{
    1010  uint_t n = 10; // compute n times
  • tests/src/pitch/test-pitchyinfft.c

    r89e9e71 rd4791e5  
    66#include <aubio.h>
    77
    8 int main ()
     8int main (void)
    99{
    1010  uint_t n = 10; // compute n times
  • tests/src/spectral/test-fft.c

    r89e9e71 rd4791e5  
    11#include <aubio.h>
    22
    3 int main ()
     3int main (void)
    44{
    55  uint_t win_s = 8; // window size
  • tests/src/spectral/test-filterbank.c

    r89e9e71 rd4791e5  
    11#include <aubio.h>
    22
    3 int main ()
     3int main (void)
    44{
    55  uint_t win_s = 1024; // window size
  • tests/src/spectral/test-filterbank_mel.c

    r89e9e71 rd4791e5  
    11#include <aubio.h>
    22
    3 int main ()
     3int main (void)
    44{
    55  uint_t samplerate = 16000; // samplerate of signal to filter
  • tests/src/spectral/test-mfcc.c

    r89e9e71 rd4791e5  
    11#include <aubio.h>
    22
    3 int main ()
     3int main (void)
    44{
    55  uint_t win_s = 512; // fft size
  • tests/src/spectral/test-phasevoc.c

    r89e9e71 rd4791e5  
    11#include <aubio.h>
    22
    3 int main ()
     3int main (void)
    44{
    55  uint_t n = 6; // compute n times
  • tests/src/spectral/test-specdesc.c

    r89e9e71 rd4791e5  
    11#include <aubio.h>
    22
    3 int main ()
     3int main (void)
    44{
    55  uint_t win_s = 1024; // window size
  • tests/src/spectral/test-tss.c

    r89e9e71 rd4791e5  
    11#include <aubio.h>
    22
    3 int main ()
     3int main (void)
    44{
    55  uint_t n = 10; // compute n times
  • tests/src/tempo/test-beattracking.c

    r89e9e71 rd4791e5  
    44#include <stdio.h>
    55
    6 int main ()
     6int main (void)
    77{
    88  uint_t i = 0;
  • tests/src/temporal/test-a_weighting.c

    r89e9e71 rd4791e5  
    11#include <aubio.h>
    22
    3 int main ()
     3int main (void)
    44{
    55 
  • tests/src/temporal/test-biquad.c

    r89e9e71 rd4791e5  
    11#include <aubio.h>
    22
    3 int main ()
     3int main (void)
    44{
    55  uint_t win_s = 64; // window size
  • tests/src/temporal/test-c_weighting.c

    r89e9e71 rd4791e5  
    11#include <aubio.h>
    22
    3 int main ()
     3int main (void)
    44{
    55  aubio_filter_t * f;
  • tests/src/temporal/test-filter.c

    r89e9e71 rd4791e5  
    11#include <aubio.h>
    22
    3 int main ()
     3int main (void)
    44{
    55  uint_t win_s = 16; // window size
  • tests/src/temporal/test-resampler.c

    r89e9e71 rd4791e5  
    11#include <aubio.h>
    22
    3 int main ()
     3int main (void)
    44{
    55  uint_t win_s = 1024; // window size
  • tests/src/test-cvec.c

    r89e9e71 rd4791e5  
    22#include "utils_tests.h"
    33
    4 int main ()
     4int main (void)
    55{
    66  uint_t i, window_size = 16; // window size
  • tests/src/test-delnull.c

    r89e9e71 rd4791e5  
    55// Programs that call these functions should check for null pointers.
    66
    7 int main ()
     7int main (void)
    88{
    99  del_fvec(NULL);
  • tests/src/test-fmat.c

    r89e9e71 rd4791e5  
    55// and j the column.
    66
    7 int main ()
     7int main (void)
    88{
    99  uint_t height = 3, length = 9, i, j;
  • tests/src/test-fvec.c

    r89e9e71 rd4791e5  
    22#include <assert.h>
    33
    4 int main ()
     4int main (void)
    55{
    66  uint_t vec_size = 10, i;
  • tests/src/test-lvec.c

    r89e9e71 rd4791e5  
    11#include <aubio.h>
     2#include "utils_tests.h"
    23
    3 int main()
     4int main (void)
    45{
    5   uint_t win_s = 1024; // window size
     6  uint_t win_s = 32; // window size
    67  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);
    715  del_lvec(sp);
    816  return 0;
  • tests/src/test-mathutils-window.c

    r89e9e71 rd4791e5  
    33#include <stdio.h>
    44
    5 int main ()
     5int main (void)
    66{
    77  uint_t length = 0;
  • tests/src/test-mathutils.c

    r89e9e71 rd4791e5  
    44#include <aubio.h>
    55
    6 int test_next_power_of_two()
     6int test_next_power_of_two (void);
     7int test_miditofreq (void);
     8int test_freqtomidi (void);
     9int test_aubio_window (void);
     10
     11int test_next_power_of_two (void)
    712{
    813  uint_t a, b;
     
    2530}
    2631
    27 int test_miditofreq()
     32int test_miditofreq (void)
    2833{
    2934  smpl_t a, b;
     
    5661}
    5762
    58 int test_freqtomidi()
     63int test_freqtomidi (void)
    5964{
    6065  smpl_t midi, freq;
     
    8893}
    8994
    90 int test_aubio_window()
     95int test_aubio_window (void)
    9196{
    9297  uint_t window_size = 16;
     
    108113}
    109114
    110 int main ()
     115int main (void)
    111116{
    112117  test_next_power_of_two();
  • tests/src/utils/test-hist.c

    r89e9e71 rd4791e5  
    33#include <aubio.h>
    44
    5 int main ()
     5int main (void)
    66{
    77  uint_t length;
  • tests/src/utils/test-parameter.c

    r89e9e71 rd4791e5  
    11#include <aubio.h>
    22#include "utils_tests.h"
     3
     4void get_some_steps ( aubio_parameter_t * param );
    35
    46void get_some_steps ( aubio_parameter_t * param )
     
    2123}
    2224
    23 int main ()
     25int main (void)
    2426{
    2527  smpl_t max_value = 100.;
  • tests/src/utils/test-scale.c

    r89e9e71 rd4791e5  
    33#include <aubio.h>
    44
    5 int main ()
     5int main (void)
    66{
    77  uint_t n = 0;
  • tests/utils_tests.h

    r89e9e71 rd4791e5  
    2727#endif
    2828
    29 void utils_init_random () {
     29void utils_init_random (void);
     30
     31void utils_init_random (void) {
    3032  time_t now = time(0);
    3133  struct tm *tm_struct = localtime(&now);
  • wscript

    r89e9e71 rd4791e5  
    8686    ctx.load('gnu_dirs')
    8787
    88     ctx.env.CFLAGS += ['-g', '-Wall', '-Wextra']
    89 
    9088    target_platform = Options.platform
    9189    if ctx.options.target_platform:
    9290        target_platform = ctx.options.target_platform
    9391    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']
    9497
    9598    if target_platform not in ['win32', 'win64']:
     
    152155    if ctx.check_cc(fragment = check_c99_varargs,
    153156            type='cstlib',
    154             msg = 'Checking for C99 __VA_ARGS__ macro'):
     157            msg = 'Checking for C99 __VA_ARGS__ macro',
     158            mandatory = False):
    155159        ctx.define('HAVE_C99_VARARGS_MACROS', 1)
    156160
Note: See TracChangeset for help on using the changeset viewer.