example_aubioDemo: add tatum and tatum signature
authorPaul Brossier <piem@piem.org>
Mon, 2 Nov 2015 23:00:13 +0000 (00:00 +0100)
committerPaul Brossier <piem@piem.org>
Mon, 2 Nov 2015 23:00:13 +0000 (00:00 +0100)
example_aubioDemo/src/ofApp.cpp
example_aubioDemo/src/ofApp.h

index 5b80bb6..9aa0dc7 100644 (file)
@@ -33,6 +33,7 @@ void ofApp::setup(){
     // setup the gui objects
     int start = 0;
     beatGui.setup("ofxAubioBeat", "settings.xml", start + 10, 10);
+    beatGui.add(bpm_tatumSignature.setup( "tatum signature", 1, 1, 64));
     beatGui.add(bpm.setup( "bpm", 0, 0, 250));
 
     start += 250;
@@ -77,6 +78,7 @@ void audioOut(){
 //--------------------------------------------------------------
 void ofApp::update(){
     onset.setThreshold(onsetThreshold);
+    beat.setTatumSignature((unsigned)bpm_tatumSignature);
 }
 
 //--------------------------------------------------------------
@@ -86,6 +88,11 @@ void ofApp::draw(){
         ofSetColor(ofColor::green);
         ofRect(90,150,50,50);
     }
+    if (beat.toSendTatum) {
+        ofSetColor(ofColor::limeGreen);
+        ofRect(140,150,25,25);
+        beat.toSendTatum = false;
+    }
 
     // update onset info
     if (onset.received()) {
index 5376022..64a9bf3 100644 (file)
@@ -37,6 +37,7 @@ class ofApp : public ofBaseApp{
         ofxFloatSlider pitchConfidence;
 
         ofxPanel beatGui;
+        ofxIntSlider bpm_tatumSignature;
         ofxFloatSlider bpm;
 
         ofxPanel onsetGui;