1 | /* |
---|
2 | Copyright (C) 2003-2009 Matthew Davies and Paul Brossier <piem@aubio.org> |
---|
3 | |
---|
4 | This file is part of aubio. |
---|
5 | |
---|
6 | aubio is free software: you can redistribute it and/or modify |
---|
7 | it under the terms of the GNU General Public License as published by |
---|
8 | the Free Software Foundation, either version 3 of the License, or |
---|
9 | (at your option) any later version. |
---|
10 | |
---|
11 | aubio is distributed in the hope that it will be useful, |
---|
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | GNU General Public License for more details. |
---|
15 | |
---|
16 | You should have received a copy of the GNU General Public License |
---|
17 | along with aubio. If not, see <http://www.gnu.org/licenses/>. |
---|
18 | |
---|
19 | */ |
---|
20 | |
---|
21 | /** \file |
---|
22 | |
---|
23 | Beat tracking using a context dependant model |
---|
24 | |
---|
25 | This file implements the causal beat tracking algorithm designed by Matthew |
---|
26 | Davies and described in the following articles: |
---|
27 | |
---|
28 | Matthew E. P. Davies and Mark D. Plumbley. Causal tempo tracking of audio. |
---|
29 | In Proceedings of the International Symposium on Music Information Retrieval |
---|
30 | (ISMIR), pages 164169, Barcelona, Spain, 2004. |
---|
31 | |
---|
32 | Matthew E. P. Davies, Paul Brossier, and Mark D. Plumbley. Beat tracking |
---|
33 | towards automatic musical accompaniment. In Proceedings of the Audio |
---|
34 | Engeeniring Society 118th Convention, Barcelona, Spain, May 2005. |
---|
35 | |
---|
36 | */ |
---|
37 | #ifndef BEATTRACKING_H |
---|
38 | #define BEATTRACKING_H |
---|
39 | |
---|
40 | #ifdef __cplusplus |
---|
41 | extern "C" { |
---|
42 | #endif |
---|
43 | |
---|
44 | /** beat tracking object */ |
---|
45 | typedef struct _aubio_beattracking_t aubio_beattracking_t; |
---|
46 | |
---|
47 | /** create beat tracking object |
---|
48 | |
---|
49 | \param hop_size number of onset detection samples [512] |
---|
50 | \param channels number (not functionnal) [1] |
---|
51 | |
---|
52 | */ |
---|
53 | aubio_beattracking_t * new_aubio_beattracking(uint_t hop_size, uint_t channels); |
---|
54 | |
---|
55 | /** track the beat |
---|
56 | |
---|
57 | \param bt beat tracking object |
---|
58 | \param dfframes current input detection function frame, smoothed by |
---|
59 | adaptive median threshold. |
---|
60 | \param out stored detected beat locations |
---|
61 | |
---|
62 | */ |
---|
63 | void aubio_beattracking_do (aubio_beattracking_t * bt, fvec_t * dfframes, |
---|
64 | fvec_t * out); |
---|
65 | |
---|
66 | /** get current tempo in bpm |
---|
67 | |
---|
68 | \param bt beat tracking object |
---|
69 | |
---|
70 | Returns the currently observed tempo, in beats per minutes, or 0 if no |
---|
71 | consistent value is found. |
---|
72 | |
---|
73 | */ |
---|
74 | smpl_t aubio_beattracking_get_bpm(aubio_beattracking_t * bt); |
---|
75 | |
---|
76 | /** get current tempo confidence |
---|
77 | |
---|
78 | \param bt beat tracking object |
---|
79 | |
---|
80 | Returns the confidence with which the tempo has been observed, 0 if no |
---|
81 | consistent value is found. |
---|
82 | |
---|
83 | */ |
---|
84 | smpl_t aubio_beattracking_get_confidence(aubio_beattracking_t * bt); |
---|
85 | |
---|
86 | /** delete beat tracking object |
---|
87 | |
---|
88 | \param p beat tracking object |
---|
89 | |
---|
90 | */ |
---|
91 | void del_aubio_beattracking(aubio_beattracking_t * p); |
---|
92 | |
---|
93 | #ifdef __cplusplus |
---|
94 | } |
---|
95 | #endif |
---|
96 | |
---|
97 | #endif /* BEATTRACKING_H */ |
---|