Changeset 155cc10 for examples/aubiotrack.c
- Timestamp:
- Mar 10, 2017, 2:26:32 PM (7 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, sampler
- Children:
- ee8a57c
- Parents:
- 00d0275 (diff), 67b6618 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/aubiotrack.c
r00d0275 r155cc10 21 21 #include "utils.h" 22 22 #define PROG_HAS_TEMPO 1 23 #define PROG_HAS_ONSET 1 24 #define PROG_HAS_SILENCE 1 23 25 #define PROG_HAS_OUTPUT 1 24 26 #define PROG_HAS_JACK 1 … … 28 30 aubio_wavetable_t *wavetable; 29 31 fvec_t * tempo_out; 30 smpl_t is_beat = 0 ;31 uint_t is_silence = 0 .;32 smpl_t is_beat = 0.; 33 uint_t is_silence = 0; 32 34 33 35 void process_block(fvec_t * ibuf, fvec_t *obuf) { … … 40 42 if ( is_beat && !is_silence ) { 41 43 aubio_wavetable_play ( wavetable ); 44 /* send a midi tap (default to C0) out to the midi output */ 45 if (usejack) send_noteon(miditap_note, miditap_velo); 42 46 } else { 43 47 aubio_wavetable_stop ( wavetable ); … … 57 61 58 62 int main(int argc, char **argv) { 63 int ret = 0; 59 64 // override general settings from utils.c 60 65 buffer_size = 1024; … … 72 77 tempo_out = new_fvec(2); 73 78 tempo = new_aubio_tempo(tempo_method, buffer_size, hop_size, samplerate); 79 if (tempo == NULL) { ret = 1; goto beach; } 74 80 // set silence threshold very low to output beats even during silence 75 81 // aubio_tempo_set_silence(tempo, -1000.); 76 82 if (onset_threshold != 0.) aubio_tempo_set_threshold (tempo, onset_threshold); 83 if (onset_minioi != 0.) errmsg ("warning: minioio not supported yet\n"); 77 84 78 85 wavetable = new_aubio_wavetable (samplerate, hop_size); … … 82 89 examples_common_process((aubio_process_func_t)process_block,process_print); 83 90 91 // send a last note off 92 if (usejack) { 93 send_noteon (miditap_note, 0); 94 } 95 84 96 del_aubio_tempo(tempo); 85 97 del_aubio_wavetable (wavetable); 86 98 del_fvec(tempo_out); 87 99 100 beach: 88 101 examples_common_del(); 89 return 0;102 return ret; 90 103 } 91
Note: See TracChangeset
for help on using the changeset viewer.