src/ofxAubioBeat.*: add tatum and tatum signature
authorPaul Brossier <piem@piem.org>
Mon, 2 Nov 2015 22:59:46 +0000 (23:59 +0100)
committerPaul Brossier <piem@piem.org>
Mon, 2 Nov 2015 22:59:46 +0000 (23:59 +0100)
src/ofxAubioBeat.cpp
src/ofxAubioBeat.h

index 2add9a0..de297dc 100644 (file)
@@ -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;
+    }
 }
index 8cc56c1..8a9e6fd 100644 (file)
@@ -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();