From bbb53a74bced38a8699d0feb95d8cfc497b7220c Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Tue, 3 Nov 2015 00:00:13 +0100 Subject: [PATCH] example_aubioDemo: add tatum and tatum signature --- example_aubioDemo/src/ofApp.cpp | 7 +++++++ example_aubioDemo/src/ofApp.h | 1 + 2 files changed, 8 insertions(+) diff --git a/example_aubioDemo/src/ofApp.cpp b/example_aubioDemo/src/ofApp.cpp index 5b80bb6..9aa0dc7 100644 --- a/example_aubioDemo/src/ofApp.cpp +++ b/example_aubioDemo/src/ofApp.cpp @@ -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()) { diff --git a/example_aubioDemo/src/ofApp.h b/example_aubioDemo/src/ofApp.h index 5376022..64a9bf3 100644 --- a/example_aubioDemo/src/ofApp.h +++ b/example_aubioDemo/src/ofApp.h @@ -37,6 +37,7 @@ class ofApp : public ofBaseApp{ ofxFloatSlider pitchConfidence; ofxPanel beatGui; + ofxIntSlider bpm_tatumSignature; ofxFloatSlider bpm; ofxPanel onsetGui; -- 2.11.0