From: Paul Brossier Date: Mon, 2 Nov 2015 22:59:46 +0000 (+0100) Subject: src/ofxAubioBeat.*: add tatum and tatum signature X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=3d19e873c064fdbbc0b1938c5894244c6303878f;p=ofxAubio.git src/ofxAubioBeat.*: add tatum and tatum signature --- diff --git a/src/ofxAubioBeat.cpp b/src/ofxAubioBeat.cpp index 2add9a0..de297dc 100644 --- a/src/ofxAubioBeat.cpp +++ b/src/ofxAubioBeat.cpp @@ -59,4 +59,14 @@ void ofxAubioBeat::blockAudioIn() toSend = true; bpm = aubio_tempo_get_bpm(tempo); } + if (aubio_tempo_was_tatum(tempo) == 1) { + toSendTatum = true; + } +} + +void ofxAubioBeat::setTatumSignature(unsigned tatumSignature) +{ + if (aubio_tempo_set_tatum_signature(tempo, tatumSignature)) { + tatum_signature = tatumSignature; + } } diff --git a/src/ofxAubioBeat.h b/src/ofxAubioBeat.h index 8cc56c1..8a9e6fd 100644 --- a/src/ofxAubioBeat.h +++ b/src/ofxAubioBeat.h @@ -36,7 +36,11 @@ class ofxAubioBeat : public ofxAubioBlock { void setup(); void setup(string method, int buf_s, int hop_s, int samplerate); + void setTatumSignature(unsigned tatumSignature); + float bpm; + unsigned tatum_signature; + bool toSendTatum; private: void blockAudioIn();