From 1aaf0a1c003034aebd21f0aee63b1b18e0eb327a Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Tue, 19 Jan 2016 17:32:08 +0100 Subject: [PATCH] src/ofxAubioBeat.h: add event for tatum --- src/ofxAubioBeat.cpp | 5 ++++- src/ofxAubioBeat.h | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) 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(); -- 2.11.0