5 // 1. allocate some memory
6 uint_t n = 0; // frame counter
7 uint_t win_s = 1024; // window size
8 uint_t hop_s = win_s / 4; // hop size
9 uint_t samplerate = 44100; // samplerate
10 // create some vectors
11 fvec_t * input = new_fvec (win_s/4); // input buffer
12 fvec_t * out = new_fvec (2); // input buffer
13 // create onset object
14 aubio_onset_t * onset = new_aubio_onset("complex", win_s, hop_s, samplerate);
16 // 2. do something with it
18 // get `hop_s` new samples into `input`
20 // exectute onset detection
21 aubio_onset_do (onset, input, out);
22 // do something with output candidates
28 del_aubio_onset(onset);