Changeset 0e0a049 for examples


Ignore:
Timestamp:
Oct 25, 2009, 9:33:24 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:
b616ffe
Parents:
a17e8c9
Message:

examples/: simplify, use fvec_ funcs

Location:
examples
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • examples/aubiomfcc.c

    ra17e8c9 r0e0a049  
    7171        outmsg("%f\t",frames*overlap_size/(float)samplerate);
    7272        for (coef_cnt = 0; coef_cnt < n_coefs; coef_cnt++) {
    73             outmsg("%f ",mfcc_out->data[0][coef_cnt]);
     73            outmsg("%f ", fvec_read_sample (mfcc_out, 0, coef_cnt) );
    7474        }
    7575        outmsg("\n");
  • examples/aubioonset.c

    ra17e8c9 r0e0a049  
    4141      aubio_onset_do (o, ibuf, onset);
    4242      if (fvec_read_sample(onset, 0, 0)) {
    43         for (pos = 0; pos < overlap_size; pos++){
    44           obuf->data[0][pos] = woodblock->data[0][pos];
    45         }
     43        fvec_copy (woodblock, obuf);
    4644      } else {
    47         for (pos = 0; pos < overlap_size; pos++) {
    48           obuf->data[0][pos] = 0.;
    49         }
     45        fvec_zeros (obuf);
    5046      }
    5147      /* end of block loop */
  • examples/aubiopitch.c

    ra17e8c9 r0e0a049  
    4242      if (fvec_read_sample(pitch, 0, 0)) {
    4343        for (pos = 0; pos < overlap_size; pos++){
    44           obuf->data[0][pos] = woodblock->data[0][pos];
     44          // TODO, play sine at this freq
    4545        }
    4646      } else {
    47         for (pos = 0; pos < overlap_size; pos++) {
    48           obuf->data[0][pos] = 0.;
    49         }
     47        fvec_zeros (obuf);
    5048      }
    5149      /* end of block loop */
  • examples/aubiotrack.c

    ra17e8c9 r0e0a049  
    4242      /* block loop */
    4343      aubio_tempo_do (bt,ibuf,tempo_out);
    44       if (tempo_out->data[0][0]>0)
    45         istactus = tempo_out->data[0][0];
    46       else
    47         istactus = 0;
    48       if (tempo_out->data[0][1]>0)
    49         isonset = tempo_out->data[0][0];
    50       else
    51         isonset = 0;
    52       if (istactus) {
    53               for (pos = 0; pos < overlap_size; pos++)
    54                       obuf->data[0][pos] = woodblock->data[0][pos];
     44      istactus = fvec_read_sample (tempo_out, 0, 0);
     45      isonset = fvec_read_sample (tempo_out, 0, 1);
     46      if (istactus > 0.) {
     47        fvec_copy (woodblock, obuf);
    5548      } else {
    56               for (pos = 0; pos < overlap_size; pos++)
    57                       obuf->data[0][pos] = 0.;
     49        fvec_zeros (obuf);
    5850      }
    5951      /* end of block loop */
Note: See TracChangeset for help on using the changeset viewer.