Changeset f3617e7 for examples/aubiotrack.c
- Timestamp:
- Nov 4, 2013, 3:28:24 PM (11 years ago)
- 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:
- e97d0b3
- Parents:
- 509e8f9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/aubiotrack.c
r509e8f9 rf3617e7 19 19 */ 20 20 21 #include <aubio.h>22 21 #include "utils.h" 23 22 24 23 uint_t pos = 0; /* frames%dspblocksize */ 24 aubio_tempo_t * bt = NULL; 25 aubio_wavetable_t *wavetable; 25 26 fvec_t * tempo_out = NULL; 26 aubio_tempo_t * bt = NULL;27 27 smpl_t istactus = 0; 28 28 smpl_t isonset = 0; … … 38 38 } 39 39 /*time for fft*/ 40 if (pos == overlap_size-1) { 40 if (pos == overlap_size-1) { 41 41 /* block loop */ 42 42 aubio_tempo_do (bt,ibuf,tempo_out); 43 43 istactus = fvec_read_sample (tempo_out, 0); 44 44 isonset = fvec_read_sample (tempo_out, 1); 45 fvec_zeros (obuf); 45 46 if (istactus > 0.) { 46 fvec_copy (woodblock, obuf);47 aubio_wavetable_play ( wavetable ); 47 48 } else { 48 fvec_zeros (obuf);49 aubio_wavetable_stop ( wavetable ); 49 50 } 51 aubio_wavetable_do (wavetable, ibuf, obuf); 50 52 /* end of block loop */ 51 53 pos = -1; /* so it will be zero next j loop */ … … 57 59 58 60 static void process_print (void) { 59 60 61 outmsg("%f\n",((smpl_t)(frames*overlap_size)+(istactus-1.)*overlap_size)/(smpl_t)samplerate);62 63 64 65 61 if (sink_uri == NULL) { 62 if (istactus) { 63 outmsg("%f\n",((smpl_t)(frames*overlap_size)+(istactus-1.)*overlap_size)/(smpl_t)samplerate); 64 } 65 if (isonset && verbose) 66 outmsg(" \t \t%f\n",(frames)*overlap_size/(float)samplerate); 67 } 66 68 } 67 69 … … 77 79 if (threshold != 0.) aubio_tempo_set_threshold (bt, threshold); 78 80 81 wavetable = new_aubio_wavetable (samplerate, overlap_size); 82 aubio_wavetable_set_freq ( wavetable, 2450.); 83 //aubio_sampler_load (sampler, "/archives/sounds/woodblock.aiff"); 84 79 85 examples_common_process(aubio_process,process_print); 80 86 81 87 del_aubio_tempo(bt); 88 del_aubio_wavetable (wavetable); 82 89 del_fvec(tempo_out); 83 90
Note: See TracChangeset
for help on using the changeset viewer.