Ignore:
Timestamp:
Oct 16, 2009, 11:03:08 PM (15 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:
6107f4c
Parents:
2828382
Message:

examples/: make use of aubio_onset in aubioonset and aubionotes, simplify, keep only general stuff in utils

File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/aubiotrack.c

    r2828382 rd4c5de7  
    2020#include "utils.h"
    2121
    22 unsigned int pos          = 0;    /* frames%dspblocksize */
    23 uint_t usepitch           = 0;
    24 fvec_t * out              = NULL;
    25 aubio_tempo_t * bt        = NULL;
    26 smpl_t istactus          = 0;
     22uint_t pos = 0;    /* frames%dspblocksize */
     23fvec_t * tempo_out = NULL;
     24aubio_tempo_t * bt = NULL;
     25smpl_t istactus = 0;
     26smpl_t isonset = 0;
    2727
    28 int aubio_process(smpl_t **input, smpl_t **output, int nframes);
    29 int aubio_process(smpl_t **input, smpl_t **output, int nframes) {
     28static int aubio_process(smpl_t **input, smpl_t **output, int nframes) {
    3029  unsigned int i;       /*channels*/
    3130  unsigned int j;       /*frames*/
     
    4241    if (pos == overlap_size-1) {         
    4342      /* block loop */
    44       aubio_tempo_do (bt,ibuf,out);
    45       if (out->data[0][0]>=1)
    46         istactus = out->data[0][0];
     43      aubio_tempo_do (bt,ibuf,tempo_out);
     44      if (tempo_out->data[0][0]>0)
     45        istactus = tempo_out->data[0][0];
    4746      else
    4847        istactus = 0;
     48      if (tempo_out->data[0][1]>0)
     49        isonset = tempo_out->data[0][0];
     50      else
     51        isonset = 0;
    4952      if (istactus) {
    5053              for (pos = 0; pos < overlap_size; pos++)
     
    6265}
    6366
    64 void process_print (void);
    65 void process_print (void) {
     67static void process_print (void) {
    6668        if (output_filename == NULL) {
    6769                if (istactus) {
     
    8082  examples_common_init(argc,argv);
    8183
    82   out = new_fvec(2,channels);
    83   bt  = new_aubio_tempo(onset_mode,buffer_size,overlap_size,channels);
     84  tempo_out = new_fvec(2,channels);
     85  bt = new_aubio_tempo(onset_mode,buffer_size,overlap_size,channels, samplerate);
    8486
    8587  examples_common_process(aubio_process,process_print);
    8688
    8789  del_aubio_tempo(bt);
    88   del_fvec(out);
     90  del_fvec(tempo_out);
    8991
    9092  examples_common_del();
Note: See TracChangeset for help on using the changeset viewer.