feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change
on this file since e8ae95ac was
b4f5967,
checked in by Paul Brossier <piem@piem.org>, 15 years ago
|
src/onset: use a string to set onset mode, keeping onset types enum private, update everywhere onsets are used
|
-
Property mode set to
100644
|
File size:
1.0 KB
|
Rev | Line | |
---|
[7ac818f] | 1 | #include <stdio.h> |
---|
[4e9101e] | 2 | #include <aubio.h> |
---|
| 3 | |
---|
| 4 | int main(){ |
---|
| 5 | /* allocate some memory */ |
---|
| 6 | uint_t win_s = 1024; /* window size */ |
---|
| 7 | uint_t channels = 1; /* number of channel */ |
---|
| 8 | fvec_t * in = new_fvec (win_s, channels); /* input buffer */ |
---|
| 9 | fvec_t * out = new_fvec (2, channels); /* input buffer */ |
---|
[b4f5967] | 10 | aubio_tempo_t * o = new_aubio_tempo("complex", win_s, win_s/4, channels); |
---|
[4e9101e] | 11 | uint_t i = 0; |
---|
| 12 | |
---|
[e34b010] | 13 | smpl_t curtempo, curtempoconf; |
---|
[cb0415d] | 14 | |
---|
[4e9101e] | 15 | while (i < 1000) { |
---|
[5bf23f7] | 16 | aubio_tempo_do(o,in,out); |
---|
[cb0415d] | 17 | curtempo = aubio_tempo_get_bpm(o); |
---|
| 18 | if (curtempo != 0.) { |
---|
| 19 | fprintf(stdout,"%f\n",curtempo); |
---|
[e34b010] | 20 | return 1; |
---|
| 21 | } |
---|
[d7a104c] | 22 | curtempoconf = aubio_tempo_get_confidence(o); |
---|
[e34b010] | 23 | if (curtempoconf != 0.) { |
---|
| 24 | fprintf(stdout,"%f\n",curtempo); |
---|
| 25 | return 1; |
---|
[cb0415d] | 26 | } |
---|
[4e9101e] | 27 | i++; |
---|
| 28 | }; |
---|
| 29 | |
---|
| 30 | del_aubio_tempo(o); |
---|
| 31 | del_fvec(in); |
---|
| 32 | del_fvec(out); |
---|
| 33 | aubio_cleanup(); |
---|
| 34 | |
---|
| 35 | return 0; |
---|
| 36 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.