diff modules-and-plug-ins/python-module/btrack_python_module.cpp @ 20:baf35f208814 develop

Replaced switch statements in OnsetDetectionFunction with enums. Renamed lots of functions so that they have better names, in camel case. Added some unit tests for initialisation of BTrack.
author Adam <adamstark.uk@gmail.com>
date Thu, 23 Jan 2014 15:31:11 +0000
parents 450c53430540
children a8e3e95d14e4
line wrap: on
line diff
--- a/modules-and-plug-ins/python-module/btrack_python_module.cpp	Thu Jan 23 12:17:06 2014 +0000
+++ b/modules-and-plug-ins/python-module/btrack_python_module.cpp	Thu Jan 23 15:31:11 2014 +0000
@@ -151,9 +151,8 @@
         b.processAudioFrame(buffer);
         
         // if a beat is currently scheduled
-		if (b.playbeat == 1)
+		if (b.beatDueInCurrentFrame())
 		{
-			//beats[beatnum] = (((double) hopSize) / 44100) * ((double) i);
 			beats[beatnum] = BTrack::getBeatTimeInSeconds(i,hopSize,44100);
             beatnum = beatnum + 1;
 		}
@@ -241,9 +240,8 @@
         
 		b.processOnsetDetectionFunctionSample(df_val);				// process df sample in beat tracker
 		
-		if (b.playbeat == 1)
+		if (b.beatDueInCurrentFrame())
 		{
-			//beats[beatnum] = (((double) hopSize) / 44100) * ((double) i);
             beats[beatnum] = BTrack::getBeatTimeInSeconds(i,hopSize,44100);
 			beatnum = beatnum + 1;	
 		}