Changes in / [1573b16:21234ee]


Ignore:
Files:
1 added
3 deleted
81 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r1573b16 r21234ee  
    1111        many ways. Several memory leaks and out of bound access have been fixed.
    1212
    13         * Optimization: the FFT, central to most algorithm, can now be computed
     13        * Optimization: the FFT, central to most algorithms, can now be computed
    1414        using different optimized algorithms, depending on what is available on your
    1515        platform (FFTW, Ooura, or vDSP). Other simple optimization tricks are
  • doc/web.cfg

    r1573b16 r21234ee  
    770770
    771771EXCLUDE                = ../src/aubio_priv.h \
    772                          ../src/mathutils \
    773                          .h \
     772                         ../src/mathutils.h \
    774773                         ../src/io/audio_unit.h \
    775774                         ../src/io/source_sndfile.h \
     
    778777                         ../src/io/sink_sndfile.h \
    779778                         ../src/io/sink_apple_audio.h \
    780                          ../src/io/sndfileio.h \
    781779                         ../src/onset/peakpicker.h \
    782780                         ../src/pitch/pitchmcomb.h \
  • examples/aubionotes.c

    r1573b16 r21234ee  
    5252
    5353  aubio_pitch_do (pitch, ibuf, pitch_obuf);
    54   smpl_t new_pitch = fvec_read_sample(pitch_obuf, 0);
     54  smpl_t new_pitch = fvec_get_sample(pitch_obuf, 0);
    5555  if(median){
    5656    note_append(note_buffer, new_pitch);
     
    5959  /* curlevel is negatif or 1 if silence */
    6060  smpl_t curlevel = aubio_level_detection(ibuf, silence_threshold);
    61   if (fvec_read_sample(onset, 0)) {
     61  if (fvec_get_sample(onset, 0)) {
    6262    /* test for silence */
    6363    if (curlevel == 1.) {
  • examples/aubioonset.c

    r1573b16 r21234ee  
    2929fvec_t *onset;
    3030smpl_t is_onset;
    31 uint_t is_silence = 0.;
    3231
    3332void
     
    3534  fvec_zeros(obuf);
    3635  aubio_onset_do (o, ibuf, onset);
    37   if (silence_threshold != -90.)
    38     is_silence = aubio_silence_detection(ibuf, silence_threshold);
    39   is_onset = fvec_read_sample(onset, 0);
    40   if ( is_onset && !is_silence ) {
     36  is_onset = fvec_get_sample(onset, 0);
     37  if ( is_onset ) {
    4138    aubio_wavetable_play ( wavetable );
    4239  } else {
     
    5249process_print (void)
    5350{
    54   if ( is_onset && !is_silence ) {
     51  if ( is_onset ) {
    5552    outmsg ("%f\n", aubio_onset_get_last_s (o) );
    5653  }
     
    6461  verbmsg ("buffer_size: %d, ", buffer_size);
    6562  verbmsg ("hop_size: %d, ", hop_size);
    66   verbmsg ("threshold: %f, ", silence_threshold);
     63  verbmsg ("silence: %f, ", silence_threshold);
    6764  verbmsg ("threshold: %f\n", onset_threshold);
    6865
    6966  o = new_aubio_onset (onset_method, buffer_size, hop_size, samplerate);
    70   if (onset_threshold != 0.) aubio_onset_set_threshold (o, onset_threshold);
     67  if (onset_threshold != 0.)
     68    aubio_onset_set_threshold (o, onset_threshold);
     69  if (silence_threshold != -90.)
     70    aubio_onset_set_silence (o, silence_threshold);
     71
    7172  onset = new_fvec (1);
    7273
  • examples/aubiopitch.c

    r1573b16 r21234ee  
    3333  fvec_zeros(obuf);
    3434  aubio_pitch_do (o, ibuf, pitch);
    35   smpl_t freq = fvec_read_sample(pitch, 0);
     35  smpl_t freq = fvec_get_sample(pitch, 0);
    3636  aubio_wavetable_set_amp ( wavetable, aubio_level_lin (ibuf) );
    3737  aubio_wavetable_set_freq ( wavetable, freq );
     
    4545void
    4646process_print (void) {
    47   smpl_t pitch_found = fvec_read_sample(pitch, 0);
     47  smpl_t pitch_found = fvec_get_sample(pitch, 0);
    4848  outmsg("%f %f\n",(blocks)
    4949      *hop_size/(float)samplerate, pitch_found);
     
    6464
    6565  o = new_aubio_pitch (pitch_method, buffer_size, hop_size, samplerate);
    66   if (pitch_tolerance != 0.) aubio_pitch_set_tolerance (o, pitch_tolerance);
    67   if (pitch_unit != NULL) aubio_pitch_set_unit (o, pitch_unit);
     66  if (pitch_tolerance != 0.)
     67    aubio_pitch_set_tolerance (o, pitch_tolerance);
     68  if (silence_threshold != -90.)
     69    aubio_pitch_set_silence (o, silence_threshold);
     70  if (pitch_unit != NULL)
     71    aubio_pitch_set_unit (o, pitch_unit);
     72
    6873  pitch = new_fvec (1);
    6974
  • examples/aubiotrack.c

    r1573b16 r21234ee  
    2929fvec_t * tempo_out;
    3030smpl_t is_beat = 0;
    31 smpl_t is_onset = 0;
    3231uint_t is_silence = 0.;
    3332
    3433void process_block(fvec_t * ibuf, fvec_t *obuf) {
    3534  aubio_tempo_do (tempo, ibuf, tempo_out);
    36   is_beat = fvec_read_sample (tempo_out, 0);
    37   is_onset = fvec_read_sample (tempo_out, 1);
     35  is_beat = fvec_get_sample (tempo_out, 0);
    3836  if (silence_threshold != -90.)
    3937    is_silence = aubio_silence_detection(ibuf, silence_threshold);
     
    5452    outmsg("%f\n", aubio_tempo_get_last_s(tempo) );
    5553  }
    56   //if ( is_onset )
    57   //  outmsg(" \t \t%f\n",(blocks)*hop_size/(float)samplerate);
    5854}
    5955
  • examples/jackio.c

    r1573b16 r21234ee  
    253253  for (j=0;j<(unsigned)nframes;j++) {
    254254    /* put synthnew in output */
    255     output[0][j] = fvec_read_sample(dev->obuf, dev->pos);
     255    output[0][j] = fvec_get_sample(dev->obuf, dev->pos);
    256256    /* write input to datanew */
    257     fvec_write_sample(dev->ibuf, input[0][j], dev->pos);
     257    fvec_set_sample(dev->ibuf, input[0][j], dev->pos);
    258258    /*time for fft*/
    259259    if (dev->pos == (int)(dev->hop_size) - 1) {
  • examples/parse_args.h

    r1573b16 r21234ee  
    6262  fprintf (stream, "usage: %s [ options ] \n", prog_name);
    6363  fprintf (stream,
    64       "       -i      --input            input type\n"
    65 #ifdef PROG_HAS_OUTPUT
    66       "       -o      --output           output type\n"
     64      "       -i      --input            input file\n"
     65#ifdef PROG_HAS_OUTPUT
     66      "       -o      --output           output file\n"
    6767#endif
    6868      "       -r      --samplerate       select samplerate\n"
     
    173173        hop_size = atoi (optarg);
    174174        break;
    175       case 'O':                /*onset type */
     175      case 'O':                /*onset method */
    176176        onset_method = optarg;
    177177        break;
  • examples/utils.c

    r1573b16 r21234ee  
    8484    this_source = new_aubio_source ((char_t*)source_uri, samplerate, hop_size);
    8585    if (this_source == NULL) {
    86       outmsg ("Could not open input file %s\n", source_uri);
     86      errmsg ("Error: could not open input file %s\n", source_uri);
    8787      exit (1);
    8888    }
     
    9393      uint_t sink_exists = (access(sink_uri, F_OK) == 0 );
    9494      if (!force_overwrite && sink_exists) {
    95         outmsg ("Output file %s already exists, use -f to overwrite.\n",
     95        errmsg ("Error: output file %s already exists, use -f to overwrite.\n",
    9696            sink_uri);
    9797        exit (1);
     
    9999      this_sink = new_aubio_sink ((char_t*)sink_uri, samplerate);
    100100      if (this_sink == NULL) {
    101         outmsg ("Could not open output file %s\n", sink_uri);
     101        errmsg ("Error: could not create output file %s\n", sink_uri);
    102102        exit (1);
    103103      }
  • examples/wscript_build

    r1573b16 r21234ee  
    11# vim:set syntax=python:
     2
     3uselib = []
     4uselib += ['JACK']
    25
    36utils_source = ['utils.c', 'jackio.c']
     
    811      source = utils_source,
    912      includes = ['../src'],
     13      uselib = uselib,
    1014      target = 'utilsio')
    1115
  • python/demos/demo_bpm_extract.py

    • Property mode changed from 100644 to 100755
  • python/demos/demo_mel-energy.py

    r1573b16 r21234ee  
    6262        ax.yaxis.set_visible(False)
    6363        ax.axis(xmax = all_desc_times[-1], xmin = all_desc_times[0])
    64         ax.annotate('band %d' % i, xy=(-10, 10),  xycoords='axes points',
     64        ax.annotate('band %d' % i, xy=(-10, 0),  xycoords='axes points',
    6565                horizontalalignment='right', verticalalignment='bottom',
     66                size = 'xx-small',
    6667                )
    6768    set_xlabels_sample2time( ax, all_desc_times[-1], samplerate)
  • python/demos/demo_pitch.py

    r1573b16 r21234ee  
    5757
    5858fig = plt.figure()
     59
    5960ax1 = fig.add_subplot(311)
    6061ax1 = get_waveform_plot(filename, samplerate = samplerate, block_size = hop_s, ax = ax1)
    61 ax1.set_xticklabels([])
     62plt.setp(ax1.get_xticklabels(), visible = False)
     63ax1.set_xlabel('')
    6264
    6365def array_from_text_file(filename, dtype = 'float'):
     
    8890#ax2.axis( ymin = 0.9 * cleaned_pitches.min(), ymax = 1.1 * cleaned_pitches.max() )
    8991#ax2.axis( ymin = 55, ymax = 70 )
    90 ax2.set_xticklabels([])
     92plt.setp(ax2.get_xticklabels(), visible = False)
     93ax2.set_ylabel('f0 (Hz)')
    9194
    9295# plot confidence
     
    97100ax3.plot(times, [tolerance]*len(confidences))
    98101ax3.axis( xmin = times[0], xmax = times[-1])
     102ax3.set_ylabel('condidence')
     103set_xlabels_sample2time(ax3, times[-1], samplerate)
    99104plt.show()
    100 set_xlabels_sample2time(ax3, times[-1], samplerate)
    101 #plt.savefig(os.path.basename(filename) + '.png', dpi=200)
     105#plt.savefig(os.path.basename(filename) + '.svg')
  • python/demos/demo_specdesc.py

    r1573b16 r21234ee  
    7272        ax.yaxis.set_visible(False)
    7373        ax.axis(xmax = all_desc_times[-1], xmin = all_desc_times[0])
    74         ax.annotate(method, xy=(-10, 10),  xycoords='axes points',
     74        ax.annotate(method, xy=(-10, 0),  xycoords='axes points',
    7575                horizontalalignment='right', verticalalignment='bottom',
    7676                )
  • python/ext/aubio-types.h

    r1573b16 r21234ee  
    6969extern PyTypeObject Py_pvocType;
    7070
     71extern PyTypeObject Py_sourceType;
     72
  • python/ext/aubiomodule.c

    r1573b16 r21234ee  
    199199      || (PyType_Ready (&Py_fftType) < 0)
    200200      || (PyType_Ready (&Py_pvocType) < 0)
     201      || (PyType_Ready (&Py_sourceType) < 0)
    201202      // generated objects
    202203      || (generated_types_ready() < 0 )
     
    227228  Py_INCREF (&Py_pvocType);
    228229  PyModule_AddObject (m, "pvoc", (PyObject *) & Py_pvocType);
     230  Py_INCREF (&Py_sourceType);
     231  PyModule_AddObject (m, "source", (PyObject *) & Py_sourceType);
    229232
    230233  // add generated objects
  • python/ext/aubioproxy.c

    r1573b16 r21234ee  
    3636    // no need to really allocate fvec, just its struct member
    3737    vec = (fvec_t *)malloc(sizeof(fvec_t));
    38     vec->length = PyArray_SIZE ((PyArrayObject *)array);
     38    long length = PyArray_SIZE ((PyArrayObject *)array);
     39    if (length > 0) {
     40      vec->length = (uint_t)length;
     41    } else {
     42      PyErr_SetString (PyExc_ValueError, "input array size should be greater than 0");
     43      goto fail;
     44    }
    3945    vec->data = (smpl_t *) PyArray_GETPTR1 ((PyArrayObject *)array, 0);
    4046
     
    131137    // no need to really allocate fvec, just its struct member
    132138    mat = (fmat_t *)malloc(sizeof(fmat_t));
    133     mat->length = PyArray_DIM ((PyArrayObject *)array, 1);
    134     mat->height = PyArray_DIM ((PyArrayObject *)array, 0);
     139    long length = PyArray_DIM ((PyArrayObject *)array, 1);
     140    if (length > 0) {
     141      mat->length = (uint_t)length;
     142    } else {
     143      PyErr_SetString (PyExc_ValueError, "input array dimension 1 should be greater than 0");
     144      goto fail;
     145    }
     146    long height = PyArray_DIM ((PyArrayObject *)array, 0);
     147    if (height > 0) {
     148      mat->height = (uint_t)height;
     149    } else {
     150      PyErr_SetString (PyExc_ValueError, "input array dimension 0 should be greater than 0");
     151      goto fail;
     152    }
    135153    mat->data = (smpl_t **)malloc(sizeof(smpl_t*) * mat->height);
    136154    for (i=0; i< mat->height; i++) {
  • python/ext/py-fft.c

    r1573b16 r21234ee  
    2525
    2626  self->win_s = Py_default_vector_length;
    27 
    28   if (self == NULL) {
    29     return NULL;
    30   }
    3127
    3228  if (win_s > 0) {
  • python/lib/gen_pyobject.py

    r1573b16 r21234ee  
    240240
    241241  self->%(pname)s = %(defval)s;
    242   if (%(pname)s > 0) {
     242  if ((sint_t)%(pname)s > 0) {
    243243    self->%(pname)s = %(pname)s;
    244   } else if (%(pname)s < 0) {
     244  } else if ((sint_t)%(pname)s < 0) {
    245245    PyErr_SetString (PyExc_ValueError,
    246246        "can not use negative value for %(pname)s");
  • python/lib/generator.py

    r1573b16 r21234ee  
    5757      'sink_apple_audio',
    5858      'sink_sndfile',
     59      'source',
    5960      'source_apple_audio',
    6061      'source_sndfile',
  • python/setup.py

    r1573b16 r21234ee  
    5454    "ext/py-fft.c",
    5555    "ext/py-phasevoc.c",
     56    "ext/py-source.c",
    5657    # generated files
    5758    ] + generated_object_files,
  • src/aubio.h

    r1573b16 r21234ee  
    185185#include "io/source.h"
    186186#include "io/sink.h"
    187 #include "io/audio_unit.h"
    188187#include "synth/sampler.h"
    189188#include "synth/wavetable.h"
     
    197196#include "io/sink_sndfile.h"
    198197#include "io/sink_apple_audio.h"
    199 #include "io/sndfileio.h"
     198#include "io/audio_unit.h"
    200199#include "onset/peakpicker.h"
    201200#include "pitch/pitchmcomb.h"
  • src/aubio_priv.h

    r1573b16 r21234ee  
    2525 */
    2626
    27 #ifndef _AUBIO_PRIV_H
    28 #define _AUBIO_PRIV_H
     27#ifndef _AUBIO__PRIV_H
     28#define _AUBIO__PRIV_H
    2929
    3030/*********************
     
    218218#define UNUSED __attribute__((unused))
    219219
    220 #endif/*_AUBIO_PRIV_H*/
     220#endif /* _AUBIO__PRIV_H */
  • src/cvec.c

    r1573b16 r21234ee  
    3939}
    4040
    41 void cvec_write_norm(cvec_t *s, smpl_t data, uint_t position) {
     41void cvec_norm_set_sample (cvec_t *s, smpl_t data, uint_t position) {
    4242  s->norm[position] = data;
    4343}
    44 void cvec_write_phas(cvec_t *s, smpl_t data, uint_t position) {
     44
     45void cvec_phas_set_sample (cvec_t *s, smpl_t data, uint_t position) {
    4546  s->phas[position] = data;
    4647}
    47 smpl_t cvec_read_norm(cvec_t *s, uint_t position) {
     48
     49smpl_t cvec_norm_get_sample (cvec_t *s, uint_t position) {
    4850  return s->norm[position];
    4951}
    50 smpl_t cvec_read_phas(cvec_t *s, uint_t position) {
     52
     53smpl_t cvec_phas_get_sample (cvec_t *s, uint_t position) {
    5154  return s->phas[position];
    5255}
    53 smpl_t * cvec_get_norm(cvec_t *s) {
     56
     57smpl_t * cvec_norm_get_data (cvec_t *s) {
    5458  return s->norm;
    5559}
    56 smpl_t * cvec_get_phas(cvec_t *s) {
     60
     61smpl_t * cvec_phas_get_data (cvec_t *s) {
    5762  return s->phas;
    5863}
     
    9297}
    9398
    94 void cvec_set_all_norm(cvec_t *s, smpl_t val) {
     99void cvec_norm_set_all (cvec_t *s, smpl_t val) {
    95100  uint_t j;
    96101  for (j=0; j< s->length; j++) {
     
    99104}
    100105
    101 void cvec_zeros_norm(cvec_t *s) {
     106void cvec_norm_zeros(cvec_t *s) {
    102107#if HAVE_MEMCPY_HACKS
    103108  memset(s->norm, 0, s->length * sizeof(smpl_t));
    104109#else
    105   cvec_set_all_norm(s, 0.);
     110  cvec_norm_set_all (s, 0.);
    106111#endif
    107112}
    108113
    109 void cvec_ones_norm(cvec_t *s) {
    110   cvec_set_all_norm(s, 1.);
     114void cvec_norm_ones(cvec_t *s) {
     115  cvec_norm_set_all (s, 1.);
    111116}
    112117
    113 void cvec_set_all_phas(cvec_t *s, smpl_t val) {
     118void cvec_phas_set_all (cvec_t *s, smpl_t val) {
    114119  uint_t j;
    115120  for (j=0; j< s->length; j++) {
     
    118123}
    119124
    120 void cvec_zeros_phas(cvec_t *s) {
     125void cvec_phas_zeros(cvec_t *s) {
    121126#if HAVE_MEMCPY_HACKS
    122127  memset(s->phas, 0, s->length * sizeof(smpl_t));
    123128#else
    124   cvec_set_all_phas(s, 0.);
     129  cvec_phas_set_all (s, 0.);
    125130#endif
    126131}
    127132
    128 void cvec_ones_phas(cvec_t *s) {
    129   cvec_set_all_phas(s, 1.);
     133void cvec_phas_ones(cvec_t *s) {
     134  cvec_phas_set_all (s, 1.);
    130135}
    131136
    132137void cvec_zeros(cvec_t *s) {
    133   cvec_zeros_norm(s);
    134   cvec_zeros_phas(s);
     138  cvec_norm_zeros(s);
     139  cvec_phas_zeros(s);
    135140}
  • src/cvec.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    1919*/
    2020
    21 #ifndef _CVEC_H
    22 #define _CVEC_H
     21#ifndef _AUBIO__CVEC_H
     22#define _AUBIO__CVEC_H
    2323
    2424#ifdef __cplusplus
     
    2828/** \file
    2929
    30   Vector of complex-valued data
     30  Vector of complex-valued data, stored in polar coordinates
    3131
    3232  This file specifies the ::cvec_t buffer type, which is used throughout aubio
    3333  to store complex data. Complex values are stored in terms of ::cvec_t.phas
    34   and norm, within size/2+1 long vectors of ::smpl_t.
     34  and norm, within 2 vectors of ::smpl_t of size (size/2+1) each.
    3535
    3636  \example test-cvec.c
     
    3838*/
    3939
    40 /** Buffer for complex data
     40/** Vector of real-valued phase and spectrum data
    4141
    4242  \code
     
    7979*/
    8080cvec_t * new_cvec(uint_t length);
     81
    8182/** cvec_t buffer deletion function
    8283
     
    8586*/
    8687void del_cvec(cvec_t *s);
     88
    8789/** write norm value in a complex buffer
    8890
    89   Note that this function is not used in the aubio library, since the same
    90   result can be obtained by assigning vec->norm[position]. Its purpose
    91   is to access these values from wrappers, as created by swig.
     91  This is equivalent to:
     92  \code
     93  s->norm[position] = val;
     94  \endcode
    9295
    9396  \param s vector to write to
    94   \param data norm value to write in s->norm[position]
     97  \param val norm value to write in s->norm[position]
    9598  \param position sample position to write to
    9699
    97100*/
    98 void cvec_write_norm(cvec_t *s, smpl_t data, uint_t position);
     101void cvec_norm_set_sample (cvec_t *s, smpl_t val, uint_t position);
     102
    99103/** write phase value in a complex buffer
    100104
    101   Note that this function is not used in the aubio library, since the same
    102   result can be obtained by assigning vec->phas[position]. Its purpose
    103   is to access these values from wrappers, as created by swig.
     105  This is equivalent to:
     106  \code
     107  s->phas[position] = val;
     108  \endcode
    104109
    105110  \param s vector to write to
    106   \param data phase value to write in s->phas[position]
     111  \param val phase value to write in s->phas[position]
    107112  \param position sample position to write to
    108113
    109114*/
    110 void cvec_write_phas(cvec_t *s, smpl_t data, uint_t position);
     115void cvec_phas_set_sample (cvec_t *s, smpl_t val, uint_t position);
     116
    111117/** read norm value from a complex buffer
    112118
    113   Note that this function is not used in the aubio library, since the same
    114   result can be obtained with vec->norm[position]. Its purpose is to
    115   access these values from wrappers, as created by swig.
     119  This is equivalent to:
     120  \code
     121  smpl_t foo = s->norm[position];
     122  \endcode
    116123
    117124  \param s vector to read from
     
    119126
    120127*/
    121 smpl_t cvec_read_norm(cvec_t *s, uint_t position);
     128smpl_t cvec_norm_get_sample (cvec_t *s, uint_t position);
     129
    122130/** read phase value from a complex buffer
    123131
    124   Note that this function is not used in the aubio library, since the same
    125   result can be obtained with vec->phas[position]. Its purpose is to
    126   access these values from wrappers, as created by swig.
     132  This is equivalent to:
     133  \code
     134  smpl_t foo = s->phas[position];
     135  \endcode
    127136
    128137  \param s vector to read from
    129138  \param position sample position to read from
    130 
    131 */
    132 smpl_t cvec_read_phas(cvec_t *s, uint_t position);
     139  \returns the value of the sample at position
     140
     141*/
     142smpl_t cvec_phas_get_sample (cvec_t *s, uint_t position);
     143
    133144/** read norm data from a complex buffer
    134145
    135   Note that this function is not used in the aubio library, since the same
    136   result can be obtained with vec->norm. Its purpose is to access these values
    137   from wrappers, as created by swig.
    138 
    139   \param s vector to read from
    140 
    141 */
    142 smpl_t * cvec_get_norm(cvec_t *s);
     146  \code
     147  smpl_t *data = s->norm;
     148  \endcode
     149
     150  \param s vector to read from
     151
     152*/
     153smpl_t * cvec_norm_get_data (cvec_t *s);
     154
    143155/** read phase data from a complex buffer
    144156
    145   Note that this function is not used in the aubio library, since the same
    146   result can be obtained with vec->phas. Its purpose is to access these values
    147   from wrappers, as created by swig.
    148 
    149   \param s vector to read from
    150 
    151 */
    152 smpl_t * cvec_get_phas(cvec_t *s);
     157  This is equivalent to:
     158  \code
     159  smpl_t *data = s->phas;
     160  \endcode
     161
     162  \param s vector to read from
     163
     164*/
     165smpl_t * cvec_phas_get_data (cvec_t *s);
    153166
    154167/** print out cvec data
     
    173186
    174187*/
    175 void cvec_set_all_norm(cvec_t *s, smpl_t val);
     188void cvec_norm_set_all (cvec_t *s, smpl_t val);
    176189
    177190/** set all norm elements to zero
     
    180193
    181194*/
    182 void cvec_zeros_norm(cvec_t *s);
     195void cvec_norm_zeros(cvec_t *s);
    183196
    184197/** set all norm elements to one
     
    187200
    188201*/
    189 void cvec_ones_norm(cvec_t *s);
     202void cvec_norm_ones(cvec_t *s);
    190203
    191204/** set all phase elements to a given value
     
    195208
    196209*/
    197 void cvec_set_all_phas(cvec_t *s, smpl_t val);
     210void cvec_phas_set_all (cvec_t *s, smpl_t val);
    198211
    199212/** set all phase elements to zero
     
    202215
    203216*/
    204 void cvec_zeros_phas(cvec_t *s);
     217void cvec_phas_zeros(cvec_t *s);
    205218
    206219/** set all phase elements to one
     
    209222
    210223*/
    211 void cvec_ones_phas(cvec_t *s);
     224void cvec_phas_ones(cvec_t *s);
    212225
    213226/** set all norm and phas elements to zero
     
    222235#endif
    223236
    224 #endif /* _CVEC_H */
    225 
     237#endif /* _AUBIO__CVEC_H */
  • src/fmat.c

    r1573b16 r21234ee  
    2222#include "fmat.h"
    2323
    24 fmat_t * new_fmat (uint_t length, uint_t height) {
     24fmat_t * new_fmat (uint_t height, uint_t length) {
    2525  if ((sint_t)length <= 0 || (sint_t)height <= 0 ) {
    2626    return NULL;
     
    4949}
    5050
    51 void fmat_write_sample(fmat_t *s, smpl_t data, uint_t channel, uint_t position) {
     51void fmat_set_sample(fmat_t *s, smpl_t data, uint_t channel, uint_t position) {
    5252  s->data[channel][position] = data;
    5353}
    54 smpl_t fmat_read_sample(fmat_t *s, uint_t channel, uint_t position) {
     54
     55smpl_t fmat_get_sample(fmat_t *s, uint_t channel, uint_t position) {
    5556  return s->data[channel][position];
    5657}
    57 void fmat_put_channel(fmat_t *s, smpl_t * data, uint_t channel) {
    58   s->data[channel] = data;
    59 }
     58
    6059void fmat_get_channel(fmat_t *s, uint_t channel, fvec_t *output) {
    6160  output->data = s->data[channel];
    6261  output->length = s->length;
    6362  return;
     63}
     64
     65smpl_t * fmat_get_channel_data(fmat_t *s, uint_t channel) {
     66  return s->data[channel];
    6467}
    6568
  • src/fmat.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2009-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    1919*/
    2020
    21 #ifndef _FMAT_H
    22 #define _FMAT_H
     21#ifndef _AUBIO__FMAT_H
     22#define _AUBIO__FMAT_H
    2323
    2424#ifdef __cplusplus
     
    5050
    5151*/
    52 fmat_t * new_fmat(uint_t length, uint_t height);
     52fmat_t * new_fmat(uint_t height, uint_t length);
     53
    5354/** fmat_t buffer deletion function
    5455
     
    5758*/
    5859void del_fmat(fmat_t *s);
     60
    5961/** read sample value in a buffer
    60 
    61   Note that this function is not used in the aubio library, since the same
    62   result can be obtained using vec->data[channel][position]. Its purpose is to
    63   access these values from wrappers, as created by swig.
    6462
    6563  \param s vector to read from
     
    6866
    6967*/
    70 smpl_t fmat_read_sample(fmat_t *s, uint_t channel, uint_t position);
     68smpl_t fmat_get_sample(fmat_t *s, uint_t channel, uint_t position);
     69
    7170/** write sample value in a buffer
    72 
    73   Note that this function is not used in the aubio library, since the same
    74   result can be obtained by assigning vec->data[channel][position]. Its purpose
    75   is to access these values from wrappers, as created by swig.
    7671
    7772  \param s vector to write to
     
    8176
    8277*/
    83 void  fmat_write_sample(fmat_t *s, smpl_t data, uint_t channel, uint_t position);
     78void  fmat_set_sample(fmat_t *s, smpl_t data, uint_t channel, uint_t position);
     79
    8480/** read channel vector from a buffer
    85 
    86   Note that this function is not used in the aubio library, since the same
    87   result can be obtained with vec->data[channel]. Its purpose is to access
    88   these values from wrappers, as created by swig.
    8981
    9082  \param s vector to read from
     
    9486*/
    9587void fmat_get_channel (fmat_t *s, uint_t channel, fvec_t *output);
    96 /** write channel vector into a buffer
    9788
    98   Note that this function is not used in the aubio library, since the same
    99   result can be obtained by assigning vec->data[channel]. Its purpose is to
    100   access these values from wrappers, as created by swig.
     89/** get vector buffer from an fmat data
    10190
    102   \param s vector to write to
    103   \param data vector of [length] values to write
    104   \param channel channel to write to
     91  \param s vector to read from
     92  \param channel channel to read from
    10593
    10694*/
    107 void fmat_put_channel(fmat_t *s, smpl_t * data, uint_t channel);
     95smpl_t * fmat_get_channel_data (fmat_t *s, uint_t channel);
     96
    10897/** read data from a buffer
    109 
    110   Note that this function is not used in the aubio library, since the same
    111   result can be obtained with vec->data. Its purpose is to access these values
    112   from wrappers, as created by swig.
    11398
    11499  \param s vector to read from
     
    176161#endif
    177162
    178 #endif /* _FMAT_H */
     163#endif /* _AUBIO__FMAT_H */
  • src/fvec.c

    r1573b16 r21234ee  
    3737}
    3838
    39 void fvec_write_sample(fvec_t *s, smpl_t data, uint_t position) {
     39void fvec_set_sample(fvec_t *s, smpl_t data, uint_t position) {
    4040  s->data[position] = data;
    4141}
    4242
    43 smpl_t fvec_read_sample(fvec_t *s, uint_t position) {
     43smpl_t fvec_get_sample(fvec_t *s, uint_t position) {
    4444  return s->data[position];
    4545}
     
    5959}
    6060
    61 void fvec_set(fvec_t *s, smpl_t val) {
     61void fvec_set_all (fvec_t *s, smpl_t val) {
    6262  uint_t j;
    6363  for (j=0; j< s->length; j++) {
     
    7070  memset(s->data, 0, s->length * sizeof(smpl_t));
    7171#else
    72   fvec_set(s, 0.);
     72  fvec_set_all (s, 0.);
    7373#endif
    7474}
    7575
    7676void fvec_ones(fvec_t *s) {
    77   fvec_set(s, 1.);
     77  fvec_set_all (s, 1.);
    7878}
    7979
  • src/fvec.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    1919*/
    2020
    21 #ifndef _FVEC_H
    22 #define _FVEC_H
     21#ifndef _AUBIO__FVEC_H
     22#define _AUBIO__FVEC_H
    2323
    2424#ifdef __cplusplus
     
    7676*/
    7777fvec_t * new_fvec(uint_t length);
     78
    7879/** fvec_t buffer deletion function
    7980
     
    8283*/
    8384void del_fvec(fvec_t *s);
     85
    8486/** read sample value in a buffer
    85 
    86   Note that this function is not used in the aubio library, since the same
    87   result can be obtained using vec->data[position]. Its purpose is to
    88   access these values from wrappers, as created by swig.
    8987
    9088  \param s vector to read from
     
    9290
    9391*/
    94 smpl_t fvec_read_sample(fvec_t *s, uint_t position);
     92smpl_t fvec_get_sample(fvec_t *s, uint_t position);
     93
    9594/** write sample value in a buffer
    96 
    97   Note that this function is not used in the aubio library, since the same
    98   result can be obtained by assigning vec->data[position]. Its purpose
    99   is to access these values from wrappers, as created by swig.
    10095
    10196  \param s vector to write to
     
    10499
    105100*/
    106 void  fvec_write_sample(fvec_t *s, smpl_t data, uint_t position);
     101void  fvec_set_sample(fvec_t *s, smpl_t data, uint_t position);
    107102
    108103/** read data from a buffer
    109 
    110   Note that this function is not used in the aubio library, since the same
    111   result can be obtained with vec->data. Its purpose is to access these values
    112   from wrappers, as created by swig.
    113104
    114105  \param s vector to read from
     
    130121
    131122*/
    132 void fvec_set(fvec_t *s, smpl_t val);
     123void fvec_set_all (fvec_t *s, smpl_t val);
    133124
    134125/** set all elements to zero
     
    176167#endif
    177168
    178 #endif /* _FVEC_H */
     169#endif /* _AUBIO__FVEC_H */
  • src/io/audio_unit.c

    r1573b16 r21234ee  
    105105
    106106  /* the floats coming from and to the device callback */
    107   o->output_frames = new_fmat(blocksize, sw_output_channels);
    108   o->input_frames = new_fmat(blocksize, sw_input_channels);
     107  o->output_frames = new_fmat(sw_output_channels, blocksize);
     108  o->input_frames = new_fmat(sw_input_channels, blocksize);
    109109
    110110  /* check for some sizes */
  • src/io/source.c

    r1573b16 r21234ee  
    2424#include "fmat.h"
    2525#include "io/source.h"
    26 #ifdef HAVE_AVCODEC
     26#ifdef HAVE_LIBAV
    2727#include "io/source_avcodec.h"
    28 #endif /* HAVE_AVCODEC */
     28#endif /* HAVE_LIBAV */
    2929#ifdef __APPLE__
    3030#include "io/source_apple_audio.h"
     
    5353aubio_source_t * new_aubio_source(char_t * uri, uint_t samplerate, uint_t hop_size) {
    5454  aubio_source_t * s = AUBIO_NEW(aubio_source_t);
    55 #if HAVE_AVCODEC
     55#if HAVE_LIBAV
    5656  s->source = (void *)new_aubio_source_avcodec(uri, samplerate, hop_size);
    5757  if (s->source) {
     
    6464    return s;
    6565  }
    66 #endif /* HAVE_AVCODEC */
     66#endif /* HAVE_LIBAV */
    6767#ifdef __APPLE__
    6868  s->source = (void *)new_aubio_source_apple_audio(uri, samplerate, hop_size);
  • src/io/source.h

    r1573b16 r21234ee  
    4141  On Mac and iOS platforms, aubio should be compiled with CoreAudio [Extended
    4242  Audio File Services]
    43   (https://developer.apple.com/library/mac/documentation/musicaudio/CAAudioTooboxRef/_index.html).
     43  (https://developer.apple.com/library/mac/documentation/MusicAudio/Reference/ExtendedAudioFileServicesReference/Reference/reference.html).
    4444  This provides access to most common audio file formats, including compressed
    4545  ones.
  • src/io/source_avcodec.c

    r1573b16 r21234ee  
    2222#include "config.h"
    2323
    24 #ifdef HAVE_AVCODEC
    25 
    26 #include <sndfile.h>
     24#ifdef HAVE_LIBAV
     25
    2726#include <libavcodec/avcodec.h>
    2827#include <libavformat/avformat.h>
     
    403402}
    404403
    405 #endif /* HAVE_SNDFILE */
     404#endif /* HAVE_LIBAV */
  • src/lvec.c

    r1573b16 r21234ee  
    4040  s->data[position] = data;
    4141}
    42 lsmp_t lvec_read_sample(lvec_t *s, uint_t position) {
     42lsmp_t lvec_get_sample(lvec_t *s, uint_t position) {
    4343  return s->data[position];
    4444}
     
    5858}
    5959
    60 void lvec_set(lvec_t *s, smpl_t val) {
     60void lvec_set_all (lvec_t *s, smpl_t val) {
    6161  uint_t j;
    6262  for (j=0; j< s->length; j++) {
     
    6969  memset(s->data, 0, s->length * sizeof(lsmp_t));
    7070#else
    71   lvec_set(s, 0.);
     71  lvec_set_all (s, 0.);
    7272#endif
    7373}
    7474
    7575void lvec_ones(lvec_t *s) {
    76   lvec_set(s, 1.);
     76  lvec_set_all (s, 1.);
    7777}
    7878
  • src/lvec.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    1919*/
    2020
    21 #ifndef _LVEC_H
    22 #define _LVEC_H
     21#ifndef _AUBIO__LVEC_H
     22#define _AUBIO__LVEC_H
    2323
    2424#ifdef __cplusplus
     
    5858*/
    5959void del_lvec(lvec_t *s);
     60
    6061/** read sample value in a buffer
    61 
    62   Note that this function is not used in the aubio library, since the same
    63   result can be obtained using vec->data[position]. Its purpose is to
    64   access these values from wrappers, as created by swig.
    6562
    6663  \param s vector to read from
     
    6865
    6966*/
    70 lsmp_t lvec_read_sample(lvec_t *s, uint_t position);
     67lsmp_t lvec_get_sample(lvec_t *s, uint_t position);
     68
    7169/** write sample value in a buffer
    72 
    73   Note that this function is not used in the aubio library, since the same
    74   result can be obtained by assigning vec->data[position]. Its purpose
    75   is to access these values from wrappers, as created by swig.
    7670
    7771  \param s vector to write to
     
    8074
    8175*/
    82 void  lvec_write_sample(lvec_t *s, lsmp_t data, uint_t position);
     76void  lvec_set_sample(lvec_t *s, lsmp_t data, uint_t position);
    8377
    8478/** read data from a buffer
    85 
    86   Note that this function is not used in the aubio library, since the same
    87   result can be obtained with vec->data. Its purpose is to access these values
    88   from wrappers, as created by swig.
    8979
    9080  \param s vector to read from
     
    10696
    10797*/
    108 void lvec_set(lvec_t *s, smpl_t val);
     98void lvec_set_all(lvec_t *s, smpl_t val);
    10999
    110100/** set all elements to zero
     
    126116#endif
    127117
    128 #endif /* _LVEC_H */
     118#endif /* _AUBIO__LVEC_H */
  • src/mathutils.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    2828 */
    2929
    30 #ifndef MATHUTILS_H
    31 #define MATHUTILS_H
     30#ifndef _AUBIO_MATHUTILS_H
     31#define _AUBIO_MATHUTILS_H
    3232
    3333#include "fvec.h"
     
    283283#endif
    284284
    285 #endif
    286 
     285#endif /* _AUBIO_MATHUTILS_H */
  • src/musicutils.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    2323 */
    2424
    25 #ifndef MUSICUTILS_H
    26 #define MUSICUTILS_H
     25#ifndef _AUBIO__MUSICUTILS_H
     26#define _AUBIO__MUSICUTILS_H
    2727
    2828#ifdef __cplusplus
     
    3131
    3232/** create window
     33
     34  \param window_type type of the window to create
     35  \param size length of the window to create (see fvec_set_window())
    3336 
     37*/
     38fvec_t *new_aubio_window (char_t * window_type, uint_t size);
     39
     40/** set elements of a vector to window coefficients
     41
     42  \param window exsting ::fvec_t to use
     43  \param window_type type of the window to create
     44
     45  List of available window types: "rectangle", "hamming", "hanning",
     46  "hanningz", "blackman", "blackman_harris", "gaussian", "welch", "parzen",
     47  "default".
     48
     49  "default" is equivalent to "hanningz".
     50
    3451  References:
    3552   
     
    4259  (<a href="http://profs.sci.univr.it/%7Edafx/Final-Papers/ps/Bernardini.ps.gz">
    4360  ps.gz</a>)
    44 
    45 */
    46 fvec_t *new_aubio_window (char_t * window_type, uint_t size);
    47 
    48 /** set elements of a vector to window coefficients
    4961
    5062 */
     
    149161#endif
    150162
    151 #endif
    152 
     163#endif /* _AUBIO__MUSICUTILS_H */
  • src/onset/onset.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2006-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2006-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    4040
    4141
    42 #ifndef ONSET_H
    43 #define ONSET_H
     42#ifndef _AUBIO_ONSET_H
     43#define _AUBIO_ONSET_H
    4444
    4545#ifdef __cplusplus
     
    269269#endif
    270270
    271 #endif /* ONSET_H */
     271#endif /* _AUBIO_ONSET_H */
  • src/onset/peakpicker.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    2727*/
    2828
    29 #ifndef PEAKPICK_H
    30 #define PEAKPICK_H
     29#ifndef _AUBIO_PEAKPICK_H
     30#define _AUBIO_PEAKPICK_H
    3131
    3232#ifdef __cplusplus
     
    5555#endif
    5656
    57 #endif /* PEAKPICK_H */
     57#endif /* _AUBIO_PEAKPICK_H */
  • src/pitch/pitch.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    1919*/
    2020
    21 #ifndef PITCH_H
    22 #define PITCH_H
     21#ifndef _AUBIO_PITCH_H
     22#define _AUBIO_PITCH_H
    2323
    2424#ifdef __cplusplus
     
    180180#endif
    181181
    182 #endif /*PITCH_H*/
     182#endif /* _AUBIO_PITCH_H */
  • src/pitch/pitchfcomb.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    3535*/
    3636
    37 #ifndef _PITCHFCOMB_H
    38 #define _PITCHFCOMB_H
     37#ifndef _AUBIO_PITCHFCOMB_H
     38#define _AUBIO_PITCHFCOMB_H
    3939
    4040#ifdef __cplusplus
     
    7474#endif
    7575
    76 #endif /* _PITCHFCOMB_H */
    77 
    78 
     76#endif /* _AUBIO_PITCHFCOMB_H */
  • src/pitch/pitchmcomb.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    3636*/
    3737
    38 #ifndef PITCHMCOMB_H
    39 #define PITCHMCOMB_H
     38#ifndef _AUBIO_PITCHMCOMB_H
     39#define _AUBIO_PITCHMCOMB_H
    4040
    4141#ifdef __cplusplus
     
    7575#endif
    7676
    77 #endif /* PITCHMCOMB_H */
     77#endif /* _AUBIO_PITCHMCOMB_H */
  • src/pitch/pitchschmitt.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    3535*/
    3636
    37 #ifndef _PITCHSCHMITT_H
    38 #define _PITCHSCHMITT_H
     37#ifndef _AUBIO_PITCHSCHMITT_H
     38#define _AUBIO_PITCHSCHMITT_H
    3939
    4040#ifdef __cplusplus
     
    7373#endif
    7474
    75 #endif /* _PITCHSCHMITT_H */
     75#endif /* _AUBIO_PITCHSCHMITT_H */
    7676
  • src/pitch/pitchspecacf.h

    r1573b16 r21234ee  
    3939*/
    4040
    41 #ifndef AUBIO_PITCHSPECACF_H
    42 #define AUBIO_PITCHSPECACF_H
     41#ifndef _AUBIO_PITCHSPECACF_H
     42#define _AUBIO_PITCHSPECACF_H
    4343
    4444#ifdef __cplusplus
     
    101101#endif
    102102
    103 #endif /*AUBIO_PITCHSPECACF_H*/
     103#endif /* _AUBIO_PITCHSPECACF_H */
  • src/pitch/pitchyin.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    3535*/
    3636
    37 #ifndef PITCHYIN_H
    38 #define PITCHYIN_H
     37#ifndef _AUBIO_PITCHYIN_H
     38#define _AUBIO_PITCHYIN_H
    3939
    4040#ifdef __cplusplus
     
    9797#endif
    9898
    99 #endif /*PITCHYIN_H*/
     99#endif /* _AUBIO_PITCHYIN_H */
  • src/pitch/pitchyinfft.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    3636*/
    3737
    38 #ifndef PITCHYINFFT_H
    39 #define PITCHYINFFT_H
     38#ifndef _AUBIO_PITCHYINFFT_H
     39#define _AUBIO_PITCHYINFFT_H
    4040
    4141#ifdef __cplusplus
     
    9797#endif
    9898
    99 #endif /*PITCHYINFFT_H*/
     99#endif /* _AUBIO_PITCHYINFFT_H */
  • src/spectral/fft.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    2323  Fast Fourier Transform
    2424
     25  Depending on how aubio was compiled, FFT are computed using one of:
     26    - [Ooura](http://www.kurims.kyoto-u.ac.jp/~ooura/fft.html)
     27    - [FFTW3](http://www.fftw.org)
     28    - [vDSP](https://developer.apple.com/library/mac/#documentation/Accelerate/Reference/vDSPRef/Reference/reference.html)
     29
    2530  \example src/spectral/test-fft.c
    2631
    2732*/
    2833
    29 #ifndef FFT_H_
    30 #define FFT_H_
     34#ifndef _AUBIO_FFT_H
     35#define _AUBIO_FFT_H
    3136
    3237#ifdef __cplusplus
     
    3641/** FFT object
    3742 
    38   This object computes forward and backward FFTs, using the complex type to
    39   store the results. The phase vocoder or aubio_mfft_t objects should be
    40   preferred to using directly aubio_fft_t. The FFT are computed using FFTW3
    41   (although support for another library could be added).
     43  This object computes forward and backward FFTs.
    4244
    4345*/
     
    140142#endif
    141143
    142 #endif // FFT_H_
     144#endif /* _AUBIO_FFT_H */
  • src/spectral/filterbank.c

    r1573b16 r21234ee  
    4444
    4545  /* allocate filter tables, a matrix of length win_s and of height n_filters */
    46   fb->filters = new_fmat (win_s / 2 + 1, n_filters);
     46  fb->filters = new_fmat (n_filters, win_s / 2 + 1);
    4747
    4848  return fb;
  • src/spectral/filterbank.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2007-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2007-2013 Paul Brossier <piem@aubio.org>
    33                      and Amaury Hazan <ahazan@iua.upf.edu>
    44
     
    3030*/
    3131
    32 #ifndef FILTERBANK_H
    33 #define FILTERBANK_H
     32#ifndef _AUBIO_FILTERBANK_H
     33#define _AUBIO_FILTERBANK_H
    3434
    3535#ifdef __cplusplus
     
    8888#endif
    8989
    90 #endif                          // FILTERBANK_H
     90#endif /* _AUBIO_FILTERBANK_H */
  • src/spectral/filterbank_mel.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2007-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2007-2013 Paul Brossier <piem@aubio.org>
    33                      and Amaury Hazan <ahazan@iua.upf.edu>
    44
     
    3232*/
    3333
    34 #ifndef FILTERBANK_MEL_H
    35 #define FILTERBANK_MEL_H
     34#ifndef _AUBIO_FILTERBANK_MEL_H
     35#define _AUBIO_FILTERBANK_MEL_H
    3636
    3737#ifdef __cplusplus
     
    7070#endif
    7171
    72 #endif // FILTERBANK_MEL_H
     72#endif /* _AUBIO_FILTERBANK_MEL_H */
  • src/spectral/mfcc.c

    r1573b16 r21234ee  
    6767  mfcc->in_dct = new_fvec (n_filters);
    6868
    69   mfcc->dct_coeffs = new_fmat (n_coefs, n_filters);
     69  mfcc->dct_coeffs = new_fmat (n_filters, n_coefs);
    7070
    7171  /* compute DCT transform dct_coeffs[i][j] as
  • src/spectral/mfcc.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2007-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2007-2013 Paul Brossier <piem@aubio.org>
    33                      and Amaury Hazan <ahazan@iua.upf.edu>
    44
     
    2828*/
    2929
    30 #ifndef MFCC_H
    31 #define MFCC_H
     30#ifndef _AUBIO_MFCC_H
     31#define _AUBIO_MFCC_H
    3232
    3333#ifdef __cplusplus
     
    7070#endif
    7171
    72 #endif                          // MFCC_H
     72#endif /* _AUBIO_MFCC_H */
  • src/spectral/phasevoc.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    3232*/
    3333
    34 #ifndef _PHASEVOC_H
    35 #define _PHASEVOC_H
     34#ifndef _AUBIO_PHASEVOC_H
     35#define _AUBIO_PHASEVOC_H
    3636
    3737#ifdef __cplusplus
     
    100100#endif
    101101
    102 #endif
     102#endif /* _AUBIO_PHASEVOC_H */
  • src/spectral/specdesc.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    2020
    2121/** \file
    22  
     22
    2323  Spectral description functions
    24  
     24
    2525  All of the following spectral description functions take as arguments the FFT
    2626  of a windowed signal (as created with aubio_pvoc). They output one smpl_t per
    2727  buffer (stored in a vector of size [1]).
    28  
     28
    2929  \section specdesc Spectral description functions
    3030
     
    3535  These functions are designed to raise at notes attacks in music signals.
    3636
    37   \b \p energy : Energy based onset detection function 
    38  
     37  \b \p energy : Energy based onset detection function
     38
    3939  This function calculates the local energy of the input spectral frame.
    40  
     40
    4141  \b \p hfc : High Frequency Content onset detection function
    42  
     42
    4343  This method computes the High Frequency Content (HFC) of the input spectral
    4444  frame. The resulting function is efficient at detecting percussive onsets.
     
    4747  Musical Signal. PhD dissertation, University of Bristol, UK, 1996.
    4848
    49   \b \p complex : Complex Domain Method onset detection function 
    50  
     49  \b \p complex : Complex Domain Method onset detection function
     50
    5151  Christopher Duxbury, Mike E. Davies, and Mark B. Sandler. Complex domain
    5252  onset detection for musical signals. In Proceedings of the Digital Audio
    5353  Effects Conference, DAFx-03, pages 90-93, London, UK, 2003.
    5454
    55   \b \p phase : Phase Based Method onset detection function 
     55  \b \p phase : Phase Based Method onset detection function
    5656
    5757  Juan-Pablo Bello, Mike P. Davies, and Mark B. Sandler. Phase-based note onset
     
    6060  Hong-Kong, 2003.
    6161
    62   \b \p specdiff : Spectral difference method onset detection function 
     62  \b \p specdiff : Spectral difference method onset detection function
    6363
    6464  Jonhatan Foote and Shingo Uchihashi. The beat spectrum: a new approach to
     
    6666  (ICME 2001), pages 881­884, Tokyo, Japan, August 2001.
    6767
    68   \b \p kl : Kullback-Liebler onset detection function 
    69  
     68  \b \p kl : Kullback-Liebler onset detection function
     69
    7070  Stephen Hainsworth and Malcom Macleod. Onset detection in music audio
    7171  signals. In Proceedings of the International Computer Music Conference
    7272  (ICMC), Singapore, 2003.
    7373
    74   \b \p mkl : Modified Kullback-Liebler onset detection function 
     74  \b \p mkl : Modified Kullback-Liebler onset detection function
    7575
    7676  Paul Brossier, ``Automatic annotation of musical audio for interactive
     
    7878  music, Queen Mary University of London, London, UK, 2006.
    7979
    80   \b \p specflux : Spectral Flux 
     80  \b \p specflux : Spectral Flux
    8181
    8282  Simon Dixon, Onset Detection Revisited, in ``Proceedings of the 9th
    8383  International Conference on Digital Audio Effects'' (DAFx-06), Montreal,
    84   Canada, 2006. 
     84  Canada, 2006.
    8585
    8686  \subsection shapedesc Spectral shape descriptors
     
    9393  href="http://www.ircam.fr/anasyn/peeters/ARTICLES/Peeters_2003_cuidadoaudiofeatures.pdf">pdf</a>)
    9494
    95   \b \p centroid : Spectral centroid 
     95  \b \p centroid : Spectral centroid
    9696
    9797  The spectral centroid represents the barycenter of the spectrum.
    9898
    9999  \e Note: This function returns the result in bin. To get the spectral
    100   centroid in Hz, aubio_bintofreq() should be used. 
     100  centroid in Hz, aubio_bintofreq() should be used.
    101101
    102   \b \p spread : Spectral spread 
     102  \b \p spread : Spectral spread
    103103
    104104  The spectral spread is the variance of the spectral distribution around its
     
    126126  Wikipedia.
    127127
    128   \b \p slope : Spectral slope 
     128  \b \p slope : Spectral slope
    129129
    130130  The spectral slope represents decreasing rate of the spectral amplitude,
     
    133133  \b \p decrease : Spectral decrease
    134134
    135   The spectral decrease is another representation of the decreasing rate, 
     135  The spectral decrease is another representation of the decreasing rate,
    136136  based on perceptual criteria.
    137137
     
    146146
    147147
    148 #ifndef ONSETDETECTION_H
    149 #define ONSETDETECTION_H
     148#ifndef _AUBIO_SPECDESC_H
     149#define _AUBIO_SPECDESC_H
    150150
    151151#ifdef __cplusplus
     
    156156typedef struct _aubio_specdesc_t aubio_specdesc_t;
    157157
    158 /** execute spectral description function on a spectral frame 
     158/** execute spectral description function on a spectral frame
    159159
    160160  Generic function to compute spectral detescription.
    161  
     161
    162162  \param o spectral description object as returned by new_aubio_specdesc()
    163163  \param fftgrain input signal spectrum as computed by aubio_pvoc_do
     
    168168    fvec_t * desc);
    169169
    170 /** creation of a spectral description object 
     170/** creation of a spectral description object
    171171
    172172  \param method spectral description method
     
    181181aubio_specdesc_t *new_aubio_specdesc (char_t * method, uint_t buf_size);
    182182
    183 /** deletion of a spectral descriptor 
     183/** deletion of a spectral descriptor
    184184
    185185  \param o spectral descriptor object as returned by new_aubio_specdesc()
     
    192192#endif
    193193
    194 #endif /* ONSETDETECTION_H */
     194#endif /* _AUBIO_SPECDESC_H */
  • src/spectral/tss.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    3737*/
    3838
    39 #ifndef TSS_H
    40 #define TSS_H
     39#ifndef _AUBIO_TSS_H
     40#define _AUBIO_TSS_H
    4141
    4242#ifdef __cplusplus
     
    101101#endif
    102102
    103 #endif /*TSS_H*/
     103#endif /* _AUBIO_TSS_H */
  • src/synth/sampler.c

    r1573b16 r21234ee  
    4343  s->blocksize = blocksize;
    4444  s->source_output = new_fvec(blocksize);
    45   s->source_output_multi = new_fmat(blocksize, 4);
     45  s->source_output_multi = new_fmat(4, blocksize);
    4646  s->source = NULL;
    4747  s->playing = 0;
  • src/synth/sampler.h

    r1573b16 r21234ee  
    1919*/
    2020
    21 #ifndef _AUBIO_SYNTH_SAMPLER_H
    22 #define _AUBIO_SYNTH_SAMPLER_H
     21#ifndef _AUBIO_SAMPLER_H
     22#define _AUBIO_SAMPLER_H
    2323
    2424/** \file
     
    138138#endif
    139139
    140 #endif /* _AUBIO_SYNTH_SAMPLER_H */
     140#endif /* _AUBIO_SAMPLER_H */
  • src/synth/wavetable.c

    r1573b16 r21234ee  
    9898      aubio_parameter_get_next_value ( s->amp );
    9999    }
    100     fvec_set(output, 0.);
     100    fvec_zeros (output);
    101101  }
    102102  // add input to output if needed
     
    131131      aubio_parameter_get_next_value ( s->amp );
    132132    }
    133     fmat_set(output, 0.);
     133    fmat_zeros (output);
    134134  }
    135135  // add output to input if needed
  • src/synth/wavetable.h

    r1573b16 r21234ee  
    1919*/
    2020
    21 #ifndef _AUBIO_SYNTH_WAVETABLE_H
    22 #define _AUBIO_SYNTH_WAVETABLE_H
     21#ifndef _AUBIO_WAVETABLE_H
     22#define _AUBIO_WAVETABLE_H
    2323
    2424/** \file
     
    176176#endif
    177177
    178 #endif /* _AUBIO_SYNTH_WAVETABLE_H */
     178#endif /* _AUBIO_WAVETABLE_H */
  • src/tempo/beattracking.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2003-2009 Matthew Davies and Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2003-2013 Matthew Davies and Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    3737 
    3838*/
    39 #ifndef BEATTRACKING_H
    40 #define BEATTRACKING_H
     39#ifndef _AUBIO_BEATTRACKING_H
     40#define _AUBIO_BEATTRACKING_H
    4141
    4242#ifdef __cplusplus
     
    9999#endif
    100100
    101 #endif /* BEATTRACKING_H */
     101#endif /* _AUBIO_BEATTRACKING_H */
  • src/tempo/tempo.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2006-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2006-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    3131*/
    3232
    33 #ifndef TEMPO_H
    34 #define TEMPO_H
     33#ifndef _AUBIO_TEMPO_H
     34#define _AUBIO_TEMPO_H
    3535
    3636#ifdef __cplusplus
     
    134134#endif
    135135
    136 #endif /* TEMPO_H */
     136#endif /* _AUBIO_TEMPO_H */
  • src/temporal/a_weighting.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    1919*/
    2020
    21 #ifndef _ADESIGN_H
    22 #define _ADESIGN_H
     21#ifndef _AUBIO_FILTER_A_DESIGN_H
     22#define _AUBIO_FILTER_A_DESIGN_H
    2323
    2424/** \file
     
    8686#endif
    8787
    88 #endif /* _ADESIGN_H */
     88#endif /* _AUBIO_FILTER_A_DESIGN_H */
  • src/temporal/biquad.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    1919*/
    2020
    21 #ifndef BIQUAD_H
    22 #define BIQUAD_H
     21#ifndef _AUBIO_FILTER_BIQUAD_H
     22#define _AUBIO_FILTER_BIQUAD_H
    2323
    2424/** \file
     
    7373#endif
    7474
    75 #endif /*BIQUAD_H*/
     75#endif /* _AUBIO_FILTER_BIQUAD_H */
  • src/temporal/c_weighting.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    1919*/
    2020
    21 #ifndef _CDESIGN_H
    22 #define _CDESIGN_H
     21#ifndef _AUBIO_FILTER_C_DESIGN_H
     22#define _AUBIO_FILTER_C_DESIGN_H
    2323
    2424/** \file
     
    8686#endif
    8787
    88 #endif /* _CDESIGN_H */
     88#endif /* _AUBIO_FILTER_C_DESIGN_H */
  • src/temporal/filter.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    1919*/
    2020
    21 #ifndef FILTER_H
    22 #define FILTER_H
     21#ifndef _AUBIO_FILTER_H
     22#define _AUBIO_FILTER_H
    2323
    2424/** \file
     
    174174#endif
    175175
    176 #endif /*FILTER_H*/
     176#endif /* _AUBIO_FILTER_H */
  • src/temporal/resampler.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    1919*/
    2020
    21 #ifndef _RESAMPLE_H
    22 #define _RESAMPLE_H
     21#ifndef _AUBIO_RESAMPLER_H
     22#define _AUBIO_RESAMPLER_H
    2323
    2424/** \file
     
    6363#endif
    6464
    65 #endif /* _RESAMPLE_H */
     65#endif /* _AUBIO_RESAMPLER_H */
  • src/types.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    1919*/
    2020
    21 #ifndef AUBIO_TYPES_H
    22 #define AUBIO_TYPES_H
     21#ifndef _AUBIO__TYPES_H
     22#define _AUBIO__TYPES_H
    2323
    2424/** \file
     
    6868#endif
    6969
    70 #endif/*AUBIO_TYPES_H*/
     70#endif /* _AUBIO__TYPES_H */
  • src/utils/hist.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    2626 */
    2727
    28 #ifndef HIST_H
    29 #define HIST_H
     28#ifndef _AUBIO_HIST_H
     29#define _AUBIO_HIST_H
    3030
    3131#ifdef __cplusplus
     
    6161#endif
    6262
    63 #endif
     63#endif /* _AUBIO_HIST_H */
  • src/utils/parameter.h

    r1573b16 r21234ee  
    158158
    159159#endif /* _AUBIO_PARAMETER_H */
    160 
  • src/utils/scale.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    2929 
    3030*/
    31 #ifndef SCALE_H
    32 #define SCALE_H
     31#ifndef _AUBIO_SCALE_H
     32#define _AUBIO_SCALE_H
    3333
    3434#ifdef __cplusplus
     
    7878#endif
    7979
    80 #endif
     80#endif /* _AUBIO_SCALE_H */
  • src/vecutils.c

    r1573b16 r21234ee  
    1515}
    1616
    17 #define AUBIO_OP_C_AND_F(OPNAME, OP) \
    18   AUBIO_OP(OPNAME, OP, fvec, data) \
    19   AUBIO_OP(OPNAME, OP, cvec, norm)
     17#define AUBIO_OP_C(OPNAME, OP) \
     18  AUBIO_OP(OPNAME, OP, fvec, data)
    2019
    21 AUBIO_OP_C_AND_F(exp, EXP)
    22 AUBIO_OP_C_AND_F(cos, COS)
    23 AUBIO_OP_C_AND_F(sin, SIN)
    24 AUBIO_OP_C_AND_F(abs, ABS)
    25 AUBIO_OP_C_AND_F(sqrt, SQRT)
    26 AUBIO_OP_C_AND_F(log10, SAFE_LOG10)
    27 AUBIO_OP_C_AND_F(log, SAFE_LOG)
    28 AUBIO_OP_C_AND_F(floor, FLOOR)
    29 AUBIO_OP_C_AND_F(ceil, CEIL)
    30 AUBIO_OP_C_AND_F(round, ROUND)
     20AUBIO_OP_C(exp, EXP)
     21AUBIO_OP_C(cos, COS)
     22AUBIO_OP_C(sin, SIN)
     23AUBIO_OP_C(abs, ABS)
     24AUBIO_OP_C(sqrt, SQRT)
     25AUBIO_OP_C(log10, SAFE_LOG10)
     26AUBIO_OP_C(log, SAFE_LOG)
     27AUBIO_OP_C(floor, FLOOR)
     28AUBIO_OP_C(ceil, CEIL)
     29AUBIO_OP_C(round, ROUND)
    3130
    32 //AUBIO_OP_C_AND_F(pow, POW)
    3331void fvec_pow (fvec_t *s, smpl_t power)
    3432{
     
    3836  }
    3937}
    40 
    41 void cvec_pow (cvec_t *s, smpl_t power)
    42 {
    43   uint_t j;
    44   for (j = 0; j < s->length; j++) {
    45     s->norm[j] = POW(s->norm[j], power);
    46   }
    47 }
    48 
  • src/vecutils.h

    r1573b16 r21234ee  
    11/*
    2   Copyright (C) 2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2009-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    2121/** \file
    2222
    23   Utility functions for ::fvec_t and ::cvec_t objects
     23  Utility functions for ::fvec_t
    2424
    2525 */
    2626
    27 #ifndef _VECUTILS_H
    28 #define _VECUTILS_H
     27#ifndef _AUBIO__VECUTILS_H
     28#define _AUBIO__VECUTILS_H
    2929
    3030#ifdef __cplusplus
     
    110110void fvec_pow (fvec_t *s, smpl_t pow);
    111111
    112 /** compute \f$e^x\f$ of each vector norm elements
    113 
    114   \param s vector to modify
    115 
    116 */
    117 void cvec_exp (cvec_t *s);
    118 
    119 /** compute \f$cos(x)\f$ of each vector norm elements
    120 
    121   \param s vector to modify
    122 
    123 */
    124 void cvec_cos (cvec_t *s);
    125 
    126 /** compute \f$sin(x)\f$ of each vector norm elements
    127 
    128   \param s vector to modify
    129 
    130 */
    131 void cvec_sin (cvec_t *s);
    132 
    133 /** compute the \f$abs(x)\f$ of each vector norm elements
    134 
    135   \param s vector to modify
    136 
    137 */
    138 void cvec_abs (cvec_t *s);
    139 
    140 /** compute the \f$sqrt(x)\f$ of each vector norm elements
    141 
    142   \param s vector to modify
    143 
    144 */
    145 void cvec_sqrt (cvec_t *s);
    146 
    147 /** compute the \f$log10(x)\f$ of each vector norm elements
    148 
    149   \param s vector to modify
    150 
    151 */
    152 void cvec_log10 (cvec_t *s);
    153 
    154 /** compute the \f$log(x)\f$ of each vector norm elements
    155 
    156   \param s vector to modify
    157 
    158 */
    159 void cvec_log (cvec_t *s);
    160 
    161 /** compute the \f$floor(x)\f$ of each vector norm elements
    162 
    163   \param s vector to modify
    164 
    165 */
    166 void cvec_floor (cvec_t *s);
    167 
    168 /** compute the \f$ceil(x)\f$ of each vector norm elements
    169 
    170   \param s vector to modify
    171 
    172 */
    173 void cvec_ceil (cvec_t *s);
    174 
    175 /** compute the \f$round(x)\f$ of each vector norm elements
    176 
    177   \param s vector to modify
    178 
    179 */
    180 void cvec_round (cvec_t *s);
    181 
    182 /** raise each vector norm elements to the power pow
    183 
    184   \param s vector to modify
    185   \param pow power to raise to
    186 
    187 */
    188 void cvec_pow (cvec_t *s, smpl_t pow);
    189 
    190112#ifdef __cplusplus
    191113}
    192114#endif
    193115
    194 #endif /*_VECUTILS_H*/
     116#endif /* _AUBIO__VECUTILS_H */
  • src/wscript_build

    r1573b16 r21234ee  
    1010uselib += ['AVRESAMPLE']
    1111uselib += ['AVUTIL']
    12 uselib += ['JACK']
    1312
    1413ctx(features = 'c',
     
    2221if ctx.env['DEST_OS'] in ['ios', 'iosimulator']:
    2322    build_features = ['cstlib']
     23elif ctx.env['DEST_OS'] in ['win32', 'win64']:
     24    build_features = ['cshlib']
    2425else: #linux, darwin, android, mingw, ...
    2526    build_features = ['cshlib', 'cstlib']
     
    2829  ctx(features = 'c ' + target,
    2930      use = ['lib_objects'], #source = source,
     31      lib = 'm',
    3032      target = 'aubio',
    3133      install_path = '${PREFIX}/lib',
  • tests/src/io/test-source_multi.c

    r1573b16 r21234ee  
    3939  if ( n_channels == 0 ) n_channels = aubio_source_get_channels(s);
    4040
    41   fmat_t *mat = new_fmat(hop_size, n_channels);
     41  fmat_t *mat = new_fmat(n_channels, hop_size);
    4242
    4343  do {
  • tests/src/spectral/test-mfcc.c

    r1573b16 r21234ee  
    1313  aubio_mfcc_t *o = new_aubio_mfcc (win_s, n_filters, n_coefs, samplerate);
    1414
    15   cvec_set_all_norm (in, 1.);
     15  cvec_norm_set_all (in, 1.);
    1616  aubio_mfcc_do (o, in, out);
    1717  fvec_print (out);
    1818
    19   cvec_set_all_norm (in, .5);
     19  cvec_norm_set_all (in, .5);
    2020  aubio_mfcc_do (o, in, out);
    2121  fvec_print (out);
  • tests/src/spectral/test-phasevoc.c

    r1573b16 r21234ee  
    1515
    1616  // fill input with some data
    17   fvec_set (in, 1.);
     17  fvec_set_all (in, 1.);
    1818  fvec_print (in);
    1919
  • tests/src/test-cvec.c

    r1573b16 r21234ee  
    2020
    2121  // set all vector elements to `0`
    22   cvec_zeros_norm(complex_vector);
     22  cvec_norm_zeros(complex_vector);
    2323  for ( i = 0; i < complex_vector->length; i++ ) {
    2424    assert( complex_vector->norm[i] == 0. );
     
    2828
    2929  // set all vector elements to `1`
    30   cvec_ones_norm(complex_vector);
     30  cvec_norm_ones(complex_vector);
    3131  for ( i = 0; i < complex_vector->length; i++ ) {
    3232    assert( complex_vector->norm[i] == 1. );
     
    3636
    3737  cvec_zeros(complex_vector);
    38   cvec_zeros_phas(complex_vector);
    39   cvec_zeros_norm(complex_vector);
    40   cvec_ones_norm(complex_vector);
    41   cvec_ones_phas(complex_vector);
     38  cvec_phas_zeros(complex_vector);
     39  cvec_norm_zeros(complex_vector);
     40  cvec_norm_ones(complex_vector);
     41  cvec_phas_ones(complex_vector);
    4242  cvec_copy(complex_vector, complex_vector);
    4343
  • tests/src/test-fmat.c

    r1573b16 r21234ee  
    99  uint_t height = 3, length = 9, i, j;
    1010  // create fmat_t object
    11   fmat_t * mat = new_fmat (length, height);
     11  fmat_t * mat = new_fmat (height, length);
    1212  for ( i = 0; i < mat->height; i++ ) {
    1313    for ( j = 0; j < mat->length; j++ ) {
  • tests/utils_tests.h

    r1573b16 r21234ee  
    44#include <math.h>
    55#include <assert.h>
     6#include "config.h"
    67
    78#define PRINT_ERR(format, args...)   fprintf(stderr, "AUBIO-TESTS ERROR: " format , ##args)
     
    910#define PRINT_DBG(format, args...)   fprintf(stderr, format , ##args)
    1011#define PRINT_WRN(format, args...)   fprintf(stderr, "AUBIO-TESTS WARNING: " format, ##args)
     12
     13#ifdef HAVE_WIN_HACKS
     14// http://en.wikipedia.org/wiki/Linear_congruential_generator
     15// no srandom/random on win32
     16
     17uint_t srandom_seed = 1029;
     18
     19void srandom(uint_t new_seed) {
     20    srandom_seed = new_seed;
     21}
     22
     23uint_t random(void) {
     24    srandom_seed = 1664525 * srandom_seed + 1013904223;
     25    return srandom_seed;
     26}
     27#endif
    1128
    1229void utils_init_random () {
  • tests/wscript_build

    r1573b16 r21234ee  
    55  includes = ['../src', '.']
    66  extra_source = []
    7   if str(target_name).endswith('-jack.c') and ctx.env['JACK']:
    8     uselib += ['JACK']
    9     includes += ['../examples']
    10     extra_source += ['../examples/jackio.c']
    117
    128  bld(features = 'c cprogram test',
  • wscript

    r1573b16 r21234ee  
    8585    ctx.load('waf_unit_test')
    8686    ctx.load('gnu_dirs')
    87     ctx.env.CFLAGS += ['-g', '-Wall', '-Wextra', '-fPIC']
     87
     88    ctx.env.CFLAGS += ['-g', '-Wall', '-Wextra']
    8889
    8990    target_platform = Options.platform
     
    9293    ctx.env['DEST_OS'] = target_platform
    9394
    94     if target_platform == 'win32':
    95         ctx.env['shlib_PATTERN'] = 'lib%s.dll'
     95    if target_platform not in ['win32', 'win64']:
     96        ctx.env.CFLAGS += ['-fPIC']
     97    else:
     98        ctx.define('HAVE_WIN_HACKS', 1)
     99        ctx.env['cshlib_PATTERN'] = 'lib%s.dll'
    96100
    97101    if target_platform == 'darwin':
     
    201205    # check for jack
    202206    if (ctx.options.enable_jack != False):
    203         ctx.check_cfg(package = 'jack', atleast_version = '0.15.0',
     207        ctx.check_cfg(package = 'jack',
    204208                args = '--cflags --libs', mandatory = False)
    205209
     
    214218        ctx.check_cfg(package = 'libavresample', atleast_version = '1.0.1',
    215219                args = '--cflags --libs', uselib_store = 'AVRESAMPLE', mandatory = False)
     220        if all ( 'HAVE_' + i in ctx.env.define_key
     221                for i in ['AVCODEC', 'AVFORMAT', 'AVUTIL', 'AVRESAMPLE'] ):
     222            ctx.define('HAVE_LIBAV', 1)
     223            ctx.msg('Checking for all libav libraries', 'yes')
     224        else:
     225            ctx.msg('Checking for all libav libraries', 'not found', color = 'YELLOW')
    216226
    217227    # use memcpy hacks
     
    233243    except ctx.errors.ConfigurationError:
    234244      ctx.to_log('txt2man was not found (ignoring)')
     245
     246    # check if doxygen is installed, optional
     247    try:
     248      ctx.find_program('doxygen', var='DOXYGEN')
     249    except ctx.errors.ConfigurationError:
     250      ctx.to_log('doxygen was not found (ignoring)')
    235251
    236252def build(bld):
     
    248264    bld( source = 'aubio.pc.in' )
    249265
    250     # build manpages from sgml files
     266    # build manpages from txt files using txt2man
    251267    if bld.env['TXT2MAN']:
    252268        from waflib import TaskGen
     
    267283        bld( source = bld.path.ant_glob('doc/*.txt') )
    268284
    269     """
    270     bld(rule = 'doxygen ${SRC}', source = 'web.cfg') #, target = 'doc/web/index.html')
    271     """
    272 
     285    # build documentation from source files using doxygen
     286    if bld.env['DOXYGEN']:
     287        bld( name = 'doxygen', rule = 'doxygen ${SRC} > /dev/null',
     288                source = 'doc/web.cfg',
     289                cwd = 'doc')
     290        bld.install_files( '${PREFIX}' + '/share/doc/libaubio-doc',
     291                bld.path.ant_glob('doc/web/html/**'),
     292                cwd = bld.path.find_dir ('doc/web'),
     293                relative_trick = True)
    273294
    274295def shutdown(bld):
     
    288309    ctx.excl += ' **/python/*.db'
    289310    ctx.excl += ' **/python.old/*'
     311    ctx.excl += ' **/python/tests/sounds'
Note: See TracChangeset for help on using the changeset viewer.