adamstark@40: BTrack - A Real-Time Beat Tracker adamstark@40: ================================= adamstark@40: adamstark@48: ** Version 0.9 ** adamstark@48: adamstark@48: *by Adam Stark, Matthew Davies and Mark Plumbley.* adamstark@48: adamstark@48: adamstark@48: About BTrack adamstark@48: ------------ adamstark@48: adamstark@48: BTrack is a causal beat tracking algorithm intended for real-time use. It is implemented in C++ with a wrapper for Python. adamstark@48: adamstark@48: Full details of the working of the algorithm can be found in: adamstark@48: adamstark@48: * 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: adamstark@48: * 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: adamstark@48: adamstark@49: Versions adamstark@49: -------- adamstark@49: adamstark@49: ==== 0.9 ==== adamstark@49: adamstark@49: * This is the original version of the BTrack algorithm adamstark@49: adamstark@49: adamstark@49: adamstark@48: License adamstark@48: ------- adamstark@48: adamstark@61: BTrack is made available under the GNU General Public License, version 3. Please see the included LICENSE.txt for more details. adamstark@61: adamstark@61: Usage - C++ adamstark@61: ----------- adamstark@61: adamstark@61: **STEP 1** adamstark@61: adamstark@61: Include the BTrack header file as follows: adamstark@61: adamstark@61: #include "BTrack.h" adamstark@61: adamstark@61: **STEP 2** adamstark@61: adamstark@61: Instantiate the algorithm by one of the following: adamstark@61: adamstark@61: // to use the default 512 hop size and 1024 frame size adamstark@61: BTrack b; adamstark@61: adamstark@61: or: adamstark@61: adamstark@61: // to specify a hop size (e.g. 512) and have a frame size of 2 x the hop size adamstark@61: BTrack b(512); adamstark@61: adamstark@61: or: adamstark@61: adamstark@61: // to specify both the hop size and frame size adamstark@61: BTrack b(512,1024); adamstark@61: adamstark@61: **STEP 3.1 - Audio Input** adamstark@61: adamstark@61: In the processing loop, fill a double precision array with one frame of audio samples (as determined in step 2): adamstark@61: adamstark@61: double *frame; adamstark@61: adamstark@61: // ! adamstark@61: // do something here to fill the frame with audio samples adamstark@61: // ! adamstark@61: adamstark@61: and then call: adamstark@61: adamstark@61: b.processAudioFrame(frame); adamstark@61: adamstark@61: and to check for beats, simply call: adamstark@61: adamstark@61: if (b.beatDueInCurrentFrame()) adamstark@61: { adamstark@61: // do something on the beat adamstark@61: } adamstark@61: adamstark@61: **STEP 3.2 - Onset Detection Function Input** adamstark@61: adamstark@61: The algorithm can process onset detection function samples. Given a double precision onset detection function sample called 'newSamples', at each step, call: adamstark@61: adamstark@61: b.processOnsetDetectionFunctionSample(newSample); adamstark@61: adamstark@61: and then check for beats with: adamstark@61: adamstark@61: if (b.beatDueInCurrentFrame()) adamstark@61: { adamstark@61: // do something on the beat adamstark@61: }