source: src/tempo/tempo.h @ deb1fd4

feature/autosinkfeature/constantqfeature/pitchshiftfeature/pydocstringsfeature/timestretchpitchshiftsamplertimestretchyinfft+
Last change on this file since deb1fd4 was deb1fd4, checked in by Paul Brossier <piem@piem.org>, 5 years ago

src/tempo/tempo.h: add aubio_tempo_get_silence and aubio_tempo_get_threshold

  • Property mode set to 100644
File size: 3.7 KB
Line 
1/*
2  Copyright (C) 2006-2013 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  Tempo detection object
24
25  This object stores all the memory required for tempo detection algorithm
26  and returns the estimated beat locations.
27
28  \example tempo/test-tempo.c
29  \example examples/aubiotrack.c
30
31*/
32
33#ifndef _AUBIO_TEMPO_H
34#define _AUBIO_TEMPO_H
35
36#ifdef __cplusplus
37extern "C" {
38#endif
39
40/** tempo detection structure */
41typedef struct _aubio_tempo_t aubio_tempo_t;
42
43/** create tempo detection object
44
45  \param method beat tracking method, unused for now (use "default")
46  \param buf_size length of FFT
47  \param hop_size number of frames between two consecutive runs
48  \param samplerate sampling rate of the signal to analyze
49
50  \return newly created ::aubio_tempo_t if successful, `NULL` otherwise
51
52*/
53aubio_tempo_t * new_aubio_tempo (char_t * method,
54    uint_t buf_size, uint_t hop_size, uint_t samplerate);
55
56/** execute tempo detection
57
58  \param o beat tracking object
59  \param input new samples
60  \param tempo output beats
61
62*/
63void aubio_tempo_do (aubio_tempo_t *o, fvec_t * input, fvec_t * tempo);
64
65/** get the time of the latest beat detected, in samples
66
67  \param o tempo detection object as returned by ::new_aubio_tempo
68
69*/
70uint_t aubio_tempo_get_last (aubio_tempo_t *o);
71
72/** get the time of the latest beat detected, in seconds
73
74  \param o tempo detection object as returned by ::new_aubio_tempo
75
76*/
77smpl_t aubio_tempo_get_last_s (aubio_tempo_t *o);
78
79/** get the time of the latest beat detected, in milliseconds
80
81  \param o tempo detection object as returned by ::new_aubio_tempo
82
83*/
84smpl_t aubio_tempo_get_last_ms (aubio_tempo_t *o);
85
86/** set tempo detection silence threshold
87
88  \param o beat tracking object
89  \param silence new silence threshold, in dB
90
91  \return `0` if successful, non-zero otherwise
92
93*/
94uint_t aubio_tempo_set_silence(aubio_tempo_t * o, smpl_t silence);
95
96/** get tempo detection silence threshold
97
98  \param o tempo detection object as returned by new_aubio_tempo()
99
100  \return current silence threshold
101
102*/
103smpl_t aubio_tempo_get_silence(aubio_tempo_t * o);
104
105/** set tempo detection peak picking threshold
106
107  \param o beat tracking object
108  \param threshold new threshold
109
110  \return `0` if successful, non-zero otherwise
111
112*/
113uint_t aubio_tempo_set_threshold(aubio_tempo_t * o, smpl_t threshold);
114
115/** get tempo peak picking threshold
116
117  \param o tempo detection object as returned by new_aubio_tempo()
118
119  \return current tempo detection threshold
120
121*/
122smpl_t aubio_tempo_get_threshold(aubio_tempo_t * o);
123
124/** get current tempo
125
126  \param o beat tracking object
127
128  \return the currently observed tempo, or `0` if no consistent value is found
129
130*/
131smpl_t aubio_tempo_get_bpm(aubio_tempo_t * o);
132
133/** get current tempo confidence
134
135  \param o beat tracking object
136
137  \return confidence with which the tempo has been observed, `0` if no
138  consistent value is found.
139
140*/
141smpl_t aubio_tempo_get_confidence(aubio_tempo_t * o);
142
143/** delete tempo detection object
144
145  \param o beat tracking object
146
147*/
148void del_aubio_tempo(aubio_tempo_t * o);
149
150#ifdef __cplusplus
151}
152#endif
153
154#endif /* _AUBIO_TEMPO_H */
Note: See TracBrowser for help on using the repository browser.