Ignore:
Timestamp:
Nov 4, 2013, 3:28:24 PM (7 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
e97d0b3
Parents:
509e8f9
Message:

examples/: use wavetable to play pitch and to replace woodblock

File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/aubioonset.c

    r509e8f9 rf3617e7  
    2121#include "utils.h"
    2222
    23 unsigned int pos = 0; /*frames%dspblocksize*/
     23uint_t pos = 0; /*frames%dspblocksize*/
    2424
    2525aubio_onset_t *o;
     26aubio_wavetable_t *wavetable;
    2627fvec_t *onset;
    2728
     
    3839    if (pos == overlap_size-1) {
    3940      /* block loop */
     41      fvec_zeros(obuf);
    4042      aubio_onset_do (o, ibuf, onset);
    4143      if ( fvec_read_sample(onset, 0) ) {
    42         fvec_copy (woodblock, obuf);
     44        aubio_wavetable_play ( wavetable );
    4345      } else {
    44         fvec_zeros (obuf);
     46        aubio_wavetable_stop ( wavetable );
    4547      }
     48      aubio_wavetable_do (wavetable, ibuf, obuf);
    4649      /* end of block loop */
    4750      pos = -1; /* so it will be zero next j loop */
     
    7376  onset = new_fvec (1);
    7477
     78  wavetable = new_aubio_wavetable (samplerate, overlap_size);
     79  aubio_wavetable_set_freq ( wavetable, 2450.);
     80  //aubio_sampler_load (sampler, "/archives/sounds/woodblock.aiff");
     81
    7582  examples_common_process(aubio_process,process_print);
    7683
    7784  del_aubio_onset (o);
     85  del_aubio_wavetable (wavetable);
    7886  del_fvec (onset);
    7987
Note: See TracChangeset for help on using the changeset viewer.