adamstark@40
|
1 BTrack - A Real-Time Beat Tracker
|
adamstark@40
|
2 =================================
|
adamstark@40
|
3
|
adamstark@75
|
4 ** Version 1.0.1 **
|
adamstark@48
|
5
|
adamstark@48
|
6 *by Adam Stark, Matthew Davies and Mark Plumbley.*
|
adamstark@48
|
7
|
adamstark@48
|
8
|
adamstark@48
|
9 About BTrack
|
adamstark@48
|
10 ------------
|
adamstark@48
|
11
|
adamstark@67
|
12 BTrack is a causal beat tracking algorithm intended for real-time use. It is implemented in C++ with wrappers for Python and the Vamp plug-in framework.
|
adamstark@48
|
13
|
adamstark@48
|
14 Full details of the working of the algorithm can be found in:
|
adamstark@48
|
15
|
adamstark@48
|
16 * Musicians and Machines: Bridging the Semantic Gap in Live Performance, Chapter 3, A. M. Stark, PhD Thesis, Queen Mary, University of London, 2011.
|
adamstark@48
|
17
|
adamstark@48
|
18 * Real-Time Beat-Synchronous Analysis of Musical Audio, A. M. Stark, M. E. P. Davies and M. D. Plumbley. In Proceedings of the 12th International Conference on Digital Audio Effects (DAFx-09), Como, Italy, September 1-4, 2009.
|
adamstark@48
|
19
|
adamstark@81
|
20 BTrack is made available under the GNU General Public License, version 3. Please see the included LICENSE.txt for more details.
|
adamstark@48
|
21
|
adamstark@49
|
22 Versions
|
adamstark@49
|
23 --------
|
adamstark@49
|
24
|
adamstark@75
|
25 ==== 1.0.1 ==== (24th November 2014)
|
adamstark@75
|
26
|
adamstark@75
|
27 * Moved to git & updated README
|
adamstark@75
|
28 * No implementation changes
|
adamstark@75
|
29
|
adamstark@70
|
30 ==== 1.0.0 ==== (8th July 2014)
|
adamstark@70
|
31
|
adamstark@70
|
32 * Many updates to stability and improvements to implementation
|
adamstark@70
|
33
|
adamstark@70
|
34 ==== 0.9.0 ==== (circa 2008/2009)
|
adamstark@49
|
35
|
adamstark@49
|
36 * This is the original version of the BTrack algorithm
|
adamstark@49
|
37
|
adamstark@49
|
38
|
adamstark@49
|
39
|
adamstark@61
|
40 Usage - C++
|
adamstark@61
|
41 -----------
|
adamstark@61
|
42
|
adamstark@61
|
43 **STEP 1**
|
adamstark@61
|
44
|
adamstark@61
|
45 Include the BTrack header file as follows:
|
adamstark@61
|
46
|
adamstark@61
|
47 #include "BTrack.h"
|
adamstark@61
|
48
|
adamstark@61
|
49 **STEP 2**
|
adamstark@61
|
50
|
adamstark@61
|
51 Instantiate the algorithm by one of the following:
|
adamstark@61
|
52
|
adamstark@61
|
53 // to use the default 512 hop size and 1024 frame size
|
adamstark@61
|
54 BTrack b;
|
adamstark@61
|
55
|
adamstark@61
|
56 or:
|
adamstark@61
|
57
|
adamstark@61
|
58 // to specify a hop size (e.g. 512) and have a frame size of 2 x the hop size
|
adamstark@61
|
59 BTrack b(512);
|
adamstark@61
|
60
|
adamstark@61
|
61 or:
|
adamstark@61
|
62
|
adamstark@61
|
63 // to specify both the hop size and frame size
|
adamstark@61
|
64 BTrack b(512,1024);
|
adamstark@61
|
65
|
adamstark@61
|
66 **STEP 3.1 - Audio Input**
|
adamstark@61
|
67
|
adamstark@61
|
68 In the processing loop, fill a double precision array with one frame of audio samples (as determined in step 2):
|
adamstark@61
|
69
|
adamstark@61
|
70 double *frame;
|
adamstark@61
|
71
|
adamstark@61
|
72 // !
|
adamstark@61
|
73 // do something here to fill the frame with audio samples
|
adamstark@61
|
74 // !
|
adamstark@61
|
75
|
adamstark@61
|
76 and then call:
|
adamstark@61
|
77
|
adamstark@61
|
78 b.processAudioFrame(frame);
|
adamstark@61
|
79
|
adamstark@61
|
80 and to check for beats, simply call:
|
adamstark@61
|
81
|
adamstark@61
|
82 if (b.beatDueInCurrentFrame())
|
adamstark@61
|
83 {
|
adamstark@61
|
84 // do something on the beat
|
adamstark@61
|
85 }
|
adamstark@61
|
86
|
adamstark@61
|
87 **STEP 3.2 - Onset Detection Function Input**
|
adamstark@61
|
88
|
adamstark@75
|
89 The algorithm can process onset detection function samples. Given a double precision onset detection function sample called 'newSample', at each step, call:
|
adamstark@61
|
90
|
adamstark@61
|
91 b.processOnsetDetectionFunctionSample(newSample);
|
adamstark@61
|
92
|
adamstark@61
|
93 and then check for beats with:
|
adamstark@61
|
94
|
adamstark@61
|
95 if (b.beatDueInCurrentFrame())
|
adamstark@61
|
96 {
|
adamstark@61
|
97 // do something on the beat
|
adamstark@61
|
98 }
|
adamstark@70
|
99
|
adamstark@81
|
100 Requirements
|
adamstark@81
|
101 ------------
|
adamstark@81
|
102
|
adamstark@81
|
103 To compile BTrack, you will require the following libraries:
|
adamstark@81
|
104
|
adamstark@81
|
105 * FFTW
|
adamstark@81
|
106 * libsamplerate
|
adamstark@81
|
107
|
adamstark@70
|
108
|
adamstark@70
|
109 License
|
adamstark@70
|
110 -------
|
adamstark@70
|
111
|
adamstark@70
|
112 Copyright (c) 2014 Queen Mary University of London
|
adamstark@70
|
113
|
adamstark@70
|
114 This program is free software: you can redistribute it and/or modify
|
adamstark@70
|
115 it under the terms of the GNU General Public License as published by
|
adamstark@70
|
116 the Free Software Foundation, either version 3 of the License, or
|
adamstark@70
|
117 (at your option) any later version.
|
adamstark@70
|
118
|
adamstark@70
|
119 This program is distributed in the hope that it will be useful,
|
adamstark@70
|
120 but WITHOUT ANY WARRANTY; without even the implied warranty of
|
adamstark@70
|
121 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
adamstark@70
|
122 GNU General Public License for more details.
|
adamstark@70
|
123
|
adamstark@70
|
124 You should have received a copy of the GNU General Public License
|
adamstark@70
|
125 along with this program. If not, see <http://www.gnu.org/licenses/>. |