Mercurial > hg > aubio-onset-detector
changeset 1:a7b9c6885eb8
added in a best slope function, a mix between max increase in the recent df function and the gradient of this increase
author | Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk> |
---|---|
date | Tue, 18 Oct 2011 14:52:27 +0100 |
parents | 8f67db3c0b01 |
children | b4c899822b4e |
files | Source/aubioOnsetDetect~.cpp |
diffstat | 1 files changed, 7 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/Source/aubioOnsetDetect~.cpp Tue Oct 18 01:28:42 2011 +0100 +++ b/Source/aubioOnsetDetect~.cpp Tue Oct 18 14:52:27 2011 +0100 @@ -216,13 +216,14 @@ //if buffer full and new result is processed (buffer is 1024 with hopsize 512 - can be set to other values) outlet_float(x->medianDetectionFunctionOutlet, x->onsetDetector->medianDetectionValue); outlet_float(x->rawDetectionFunctionOutlet, x->onsetDetector->rawDetectionValue); - outlet_float(x->detectionFunctionOutlet, x->onsetDetector->peakPickedDetectionValue); + // outlet_float(x->detectionFunctionOutlet, x->onsetDetector->peakPickedDetectionValue); + outlet_float(x->detectionFunctionOutlet, x->onsetDetector->bestSlopeValue); - if (x->useMedianOnsetDetection && x->onsetDetector->anrMedianProcessedOnsetFound) - outlet_bang(x->bangoutlet); + if (x->onsetDetector->anrMedianProcessedOnsetFound) + outlet_bang(x->medianBangOutlet); - if (!x->useMedianOnsetDetection && x->onsetDetector->aubioOnsetFound) + if (x->onsetDetector->aubioOnsetFound) outlet_bang(x->bangoutlet); @@ -283,6 +284,7 @@ // use 0 if you don't need inlets x->medianDetectionFunctionOutlet = floatout(x); + x->medianBangOutlet = bangout(x); x->rawDetectionFunctionOutlet = floatout(x); x->detectionFunctionOutlet = floatout(x); x->bangoutlet = bangout(x); @@ -307,7 +309,7 @@ t_atom my_atom = argv[0]; object_post((t_object*)x, (char*) "Aubio Onset Detect found, created by Andrew Robertson from work by Paul Brossier, Queen Mary University"); - post("Threshold set to %f ", atom_getfloat(&my_atom)); + object_post((t_object*)x, (char*) "Threshold set to %f ", atom_getfloat(&my_atom)); x->threshold = atom_getfloat(&my_atom); if (x->threshold > 10)