Changeset d4c5de7 for examples/aubiotrack.c
- Timestamp:
- Oct 16, 2009, 11:03:08 PM (15 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:
- 6107f4c
- Parents:
- 2828382
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/aubiotrack.c
r2828382 rd4c5de7 20 20 #include "utils.h" 21 21 22 u nsigned int pos= 0; /* frames%dspblocksize */23 uint_t usepitch = 0;24 fvec_t * out= NULL;25 aubio_tempo_t * bt = NULL;26 smpl_t is tactus= 0;22 uint_t pos = 0; /* frames%dspblocksize */ 23 fvec_t * tempo_out = NULL; 24 aubio_tempo_t * bt = NULL; 25 smpl_t istactus = 0; 26 smpl_t isonset = 0; 27 27 28 int aubio_process(smpl_t **input, smpl_t **output, int nframes); 29 int aubio_process(smpl_t **input, smpl_t **output, int nframes) { 28 static int aubio_process(smpl_t **input, smpl_t **output, int nframes) { 30 29 unsigned int i; /*channels*/ 31 30 unsigned int j; /*frames*/ … … 42 41 if (pos == overlap_size-1) { 43 42 /* 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]; 47 46 else 48 47 istactus = 0; 48 if (tempo_out->data[0][1]>0) 49 isonset = tempo_out->data[0][0]; 50 else 51 isonset = 0; 49 52 if (istactus) { 50 53 for (pos = 0; pos < overlap_size; pos++) … … 62 65 } 63 66 64 void process_print (void); 65 void process_print (void) { 67 static void process_print (void) { 66 68 if (output_filename == NULL) { 67 69 if (istactus) { … … 80 82 examples_common_init(argc,argv); 81 83 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); 84 86 85 87 examples_common_process(aubio_process,process_print); 86 88 87 89 del_aubio_tempo(bt); 88 del_fvec( out);90 del_fvec(tempo_out); 89 91 90 92 examples_common_del();
Note: See TracChangeset
for help on using the changeset viewer.