#include "ofxAubioOnset.h"
#include "ofLog.h"
+ofEvent<float> ofxAubioOnset::gotGlobalOnset = ofEvent<float>();
+
ofxAubioOnset::ofxAubioOnset()
{
}
if (aubio_output->data[0]) {
toSend = true;
//ofLogNotice() << "found onset";
+ float last_onset = aubio_onset_get_last_s(onset);
+ ofNotifyEvent(gotOnset, last_onset, this);
+ ofNotifyEvent(gotGlobalOnset, last_onset);
}
novelty = aubio_onset_get_descriptor(onset);
thresholdedNovelty = aubio_onset_get_thresholded_descriptor(onset);
#include <iostream>
#include <aubio/aubio.h>
+#include "ofEvents.h"
#include "ofxAubioBlock.h"
class ofxAubioOnset : public ofxAubioBlock {
ofxAubioOnset();
~ofxAubioOnset();
+ ofEvent<float> gotOnset;
+ static ofEvent<float> gotGlobalOnset;
+
void setup();
void setup(std::string method, int buf_s, int hop_s, int samplerate);