From 63971c9b5e2dcfa1b7e254cac9cac5629c776835 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Thu, 23 May 2013 18:19:13 +0100 Subject: rearrange folders: working vamp host --- vamphost/src/ofxVamphost.cpp | 10 ++++++++++ vamphost/src/ofxVamphost.h | 5 +++++ vamphost/src/testApp.cpp | 11 ++++++++--- vamphost/vamphost.cbp | 6 ++++++ 4 files changed, 29 insertions(+), 3 deletions(-) (limited to 'vamphost') diff --git a/vamphost/src/ofxVamphost.cpp b/vamphost/src/ofxVamphost.cpp index 1ba2b4e..3844c60 100644 --- a/vamphost/src/ofxVamphost.cpp +++ b/vamphost/src/ofxVamphost.cpp @@ -127,6 +127,11 @@ int Vamphost::init(const string &soname,const string &id,const int &_channels,co featureNo=1; + + avg=0.0f; + num=0; + numFeat=0; + return blockSize; } void Vamphost::process_frame(float *data,int samples_in_frame){ @@ -145,6 +150,8 @@ void Vamphost::process_frame(float *data,int samples_in_frame){ while(sampleprocess(plugbuf, rt); + if (feat[outputNo].size()>0) cerr<<"BEAT"< //this is the best way to store features: because map allows to search for the key below and above the present time int getRT(); + + float avg; + int num; + int numFeat; private: PluginLoader *loader; @@ -45,6 +49,7 @@ class Vamphost{ int featureNo; + }; #endif diff --git a/vamphost/src/testApp.cpp b/vamphost/src/testApp.cpp index b431fce..659ed35 100644 --- a/vamphost/src/testApp.cpp +++ b/vamphost/src/testApp.cpp @@ -22,8 +22,12 @@ void testApp::setup() { int channels=1; int outputNo=0; - string soname="qm-vamp-plugins"; - string id="qm-tempotracker"; + //string soname="qm-vamp-plugins"; + //string id="qm-tempotracker"; + //string id="qm-barbeattracker"; + + string soname="vamp-example-plugins.so"; + string id="percussiononsets"; int bufferSize = vamphost.init(soname,id,channels,rate,outputNo); @@ -149,7 +153,7 @@ ofSetColor(225); ofSetColor(225); string reportString = "buffers received: "+ofToString(bufferCounter)+"\ndraw routines called: "+ofToString(drawCounter)+"\nticks: " + ofToString(soundStream.getTickCount()); - reportString +="\nfeatures found: "+ofToString(vamphost.features.size()); + reportString +="\nfeatures found: "+ofToString(vamphost.numFeat)+" average signal: "+ofToString(vamphost.avg)+" samples: "+ofToString(vamphost.num); ofDrawBitmapString(reportString, 32, 589); } @@ -183,6 +187,7 @@ void testApp::audioIn(float * input, int bufferSize, int nChannels){ bufferCounter++; + //input would seem to be in the range 0..1 vamphost.process_frame(input,bufferSize); diff --git a/vamphost/vamphost.cbp b/vamphost/vamphost.cbp index 4137986..6a22a01 100755 --- a/vamphost/vamphost.cbp +++ b/vamphost/vamphost.cbp @@ -36,6 +36,12 @@ + + + + -- cgit v1.2.3