src/ofxAubioBeat.h: add event for tatum
authorPaul Brossier <piem@piem.org>
Tue, 19 Jan 2016 16:32:08 +0000 (17:32 +0100)
committerPaul Brossier <piem@piem.org>
Tue, 19 Jan 2016 16:32:08 +0000 (17:32 +0100)
src/ofxAubioBeat.cpp
src/ofxAubioBeat.h

index de4c867..ec3e19b 100644 (file)
@@ -22,6 +22,7 @@
 #include "ofLog.h"
 
 ofEvent<float> ofxAubioBeat::gotGlobalBeat = ofEvent<float>();
+ofEvent<int> ofxAubioBeat::gotGlobalTatum = ofEvent<int>();
 
 ofxAubioBeat::ofxAubioBeat()
 {
@@ -65,7 +66,9 @@ void ofxAubioBeat::blockAudioIn()
         ofNotifyEvent(gotGlobalBeat, last_beat);
     }
     if (aubio_tempo_was_tatum(tempo) == 1) {
-        toSendTatum = true;
+        int last_tatum = aubio_tempo_get_last_tatum(tempo);
+        ofNotifyEvent(gotTatum, last_tatum, this);
+        ofNotifyEvent(gotGlobalTatum, last_tatum);
     }
 }
 
index 55d282e..4f84d9f 100644 (file)
@@ -36,6 +36,8 @@ class ofxAubioBeat : public ofxAubioBlock {
 
        ofEvent<float> gotBeat;
        static ofEvent<float> gotGlobalBeat;
+       ofEvent<int> gotTatum;
+       static ofEvent<int> gotGlobalTatum;
 
        void setup();
        void setup(string method, int buf_s, int hop_s, int samplerate);
@@ -44,7 +46,6 @@ class ofxAubioBeat : public ofxAubioBlock {
 
        float bpm;
        unsigned tatum_signature;
-       bool toSendTatum;
 
     private:
        void blockAudioIn();