From: Paul Brossier Date: Tue, 19 Jan 2016 16:32:08 +0000 (+0100) Subject: src/ofxAubioBeat.h: add event for tatum X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=1aaf0a1c003034aebd21f0aee63b1b18e0eb327a;p=ofxAubio.git src/ofxAubioBeat.h: add event for tatum --- diff --git a/src/ofxAubioBeat.cpp b/src/ofxAubioBeat.cpp index de4c867..ec3e19b 100644 --- a/src/ofxAubioBeat.cpp +++ b/src/ofxAubioBeat.cpp @@ -22,6 +22,7 @@ #include "ofLog.h" ofEvent ofxAubioBeat::gotGlobalBeat = ofEvent(); +ofEvent ofxAubioBeat::gotGlobalTatum = ofEvent(); 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); } } diff --git a/src/ofxAubioBeat.h b/src/ofxAubioBeat.h index 55d282e..4f84d9f 100644 --- a/src/ofxAubioBeat.h +++ b/src/ofxAubioBeat.h @@ -36,6 +36,8 @@ class ofxAubioBeat : public ofxAubioBlock { ofEvent gotBeat; static ofEvent gotGlobalBeat; + ofEvent gotTatum; + static ofEvent 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();