# HG changeset patch # User Andrew N Robertson # Date 1318945947 -3600 # Node ID a7b9c6885eb8b449aee343ca2d3a591ce591823e # Parent 8f67db3c0b01bc216ad2441c5555b25a64c3d19d added in a best slope function, a mix between max increase in the recent df function and the gradient of this increase diff -r 8f67db3c0b01 -r a7b9c6885eb8 Source/aubioOnsetDetect~.cpp --- 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)