#include "ofxAubioBeat.h"
#include "ofLog.h"
+ofEvent<float> ofxAubioBeat::gotGlobalBeat = ofEvent<float>();
+
ofxAubioBeat::ofxAubioBeat()
{
}
aubio_tempo_do(tempo, aubio_input, aubio_output);
if (aubio_output->data[0]) {
//ofLogNotice() << "found beat: " << aubio_output->data[0];
- toSend = true;
bpm = aubio_tempo_get_bpm(tempo);
+ float last_beat = aubio_tempo_get_last_s(tempo);
+ ofNotifyEvent(gotBeat, last_beat, this);
+ ofNotifyEvent(gotGlobalBeat, last_beat);
}
}
#include <iostream>
#include <aubio/aubio.h>
+#include "ofEvents.h"
#include "ofxAubioBlock.h"
using namespace std;
ofxAubioBeat();
~ofxAubioBeat();
+ ofEvent<float> gotBeat;
+ static ofEvent<float> gotGlobalBeat;
+
void setup();
void setup(string method, int buf_s, int hop_s, int samplerate);