changeset 78:866024f9f95a

Added initial basic Max external and implemented getCurrentTempoEstimate() in BTrack.cpp
author Adam Stark <adamstark.uk@gmail.com>
date Mon, 24 Nov 2014 11:48:08 +0000
parents 7d3622243e9a
children 9fd4075b8f9e
files .gitignore modules-and-plug-ins/max-external/Info.plist modules-and-plug-ins/max-external/README.md modules-and-plug-ins/max-external/btrack~.cpp modules-and-plug-ins/max-external/btrack~.xcodeproj/project.pbxproj modules-and-plug-ins/max-external/maxmspsdk.xcconfig src/BTrack.cpp
diffstat 7 files changed, 663 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/.gitignore	Fri Nov 21 13:26:54 2014 +0000
+++ b/.gitignore	Mon Nov 24 11:48:08 2014 +0000
@@ -6,4 +6,6 @@
 *.o
 *.dylib
 
-*.xcworkspace
\ No newline at end of file
+*.xcworkspace
+
+modules-and-plug-ins/max-external/build
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules-and-plug-ins/max-external/Info.plist	Mon Nov 24 11:48:08 2014 +0000
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>English</string>
+	<key>CFBundleExecutable</key>
+	<string>${PRODUCT_NAME}</string>
+	<key>CFBundleIconFile</key>
+	<string></string>
+	<key>CFBundleIdentifier</key>
+	<string>com.cycling74.${PRODUCT_NAME:rfc1034identifier}</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>${PRODUCT_VERSION}</string>
+	<key>CFBundlePackageType</key>
+	<string>iLaX</string>
+	<key>CFBundleSignature</key>
+	<string>max2</string>
+	<key>CFBundleVersion</key>
+	<string>1.0</string>
+
+	<key>CFBundleVersion</key>
+	<string>${PRODUCT_VERSION}</string>
+	<key>CFBundleShortVersionString</key>
+	<string>${PRODUCT_VERSION}</string>
+	<key>CFBundleLongVersionString</key>
+	<string>${PRODUCT_NAME} ${PRODUCT_VERSION}, Copyright 2013 Cycling '74</string>
+
+	<key>CSResourcesFileMapped</key>
+	<true/>
+</dict>
+</plist>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules-and-plug-ins/max-external/README.md	Mon Nov 24 11:48:08 2014 +0000
@@ -0,0 +1,16 @@
+BTrack Max External: btrack~
+============================
+
+
+Build Instructions
+------------------
+
+1. Edit the file maxmspsdk.xcconfig, setting the path to the c74support folder in your version of the Max SDK:
+
+
+	// ===========================================================================
+	// NOTE: SET PATH TO YOUR C74SUPPORT FOLDER IN YOUR MAX SDK HERE
+	
+	C74SUPPORT = $(SRCROOT)/../../../SDKs/MaxSDK-6.1.4/c74support/
+	
+	// ===========================================================================			
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules-and-plug-ins/max-external/btrack~.cpp	Mon Nov 24 11:48:08 2014 +0000
@@ -0,0 +1,256 @@
+//===========================================================================
+/** @file btrack~.cpp
+ *  @brief The btrack~ Max external
+ *  @author Adam Stark
+ *  @copyright Copyright (C) 2008-2014  Queen Mary University of London
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+//===========================================================================
+
+//===========================================================================
+#include "ext.h"			// standard Max include, always required (except in Jitter)
+#include "ext_obex.h"		// required for "new" style objects
+#include "z_dsp.h"			// required for MSP objects
+
+//===========================================================================
+// BTrack includes
+#include "../../src/BTrack.h"
+#include "../../src/OnsetDetectionFunction.h"
+
+//===========================================================================
+// struct to represent the object's state
+typedef struct _btrack {
+    
+    // The object itself (t_pxobject in MSP instead of t_object)
+	t_pxobject		ob;
+    
+    // An instance of the BTrack beat tracker
+    BTrack			*b;
+    
+    // An outlet for beats
+    void            *beat_outlet;
+    
+    // An outlet for tempo estimates
+    void            *tempo_outlet;
+    
+} t_btrack;
+
+
+//===========================================================================
+// method prototypes
+void *btrack_new(t_symbol *s, long argc, t_atom *argv);
+void btrack_free(t_btrack *x);
+void btrack_assist(t_btrack *x, void *b, long m, long a, char *s);
+void btrack_float(t_btrack *x, double f);
+void btrack_dsp(t_btrack *x, t_signal **sp, short *count);
+void btrack_dsp64(t_btrack *x, t_object *dsp64, short *count, double samplerate, long maxvectorsize, long flags);
+t_int *btrack_perform(t_int *w);
+void btrack_perform64(t_btrack *x, t_object *dsp64, double **ins, long numins, double **outs, long numouts, long sampleframes, long flags, void *userparam);
+
+//===========================================================================
+void btrack_process(t_btrack *x,double* audioFrame);
+void outlet_beat(t_btrack *x, t_symbol *s, long argc, t_atom *argv);
+
+// global class pointer variable
+static t_class *btrack_class = NULL;
+
+
+
+
+//===========================================================================
+int C74_EXPORT main(void)
+{	
+	// object initialization, note the use of dsp_free for the freemethod, which is required
+	// unless you need to free allocated memory, in which case you should call dsp_free from
+	// your custom free function.
+
+	t_class *c = class_new("btrack~", (method)btrack_new, (method)dsp_free, (long)sizeof(t_btrack), 0L, A_GIMME, 0);
+	
+	class_addmethod(c, (method)btrack_float,		"float",	A_FLOAT, 0);
+	class_addmethod(c, (method)btrack_dsp,		"dsp",		A_CANT, 0);		// Old 32-bit MSP dsp chain compilation for Max 5 and earlier
+	class_addmethod(c, (method)btrack_dsp64,		"dsp64",	A_CANT, 0);		// New 64-bit MSP dsp chain compilation for Max 6
+	class_addmethod(c, (method)btrack_assist,	"assist",	A_CANT, 0);
+	
+	class_dspinit(c);
+	class_register(CLASS_BOX, c);
+	btrack_class = c;
+
+	return 0;
+}
+
+
+//===========================================================================
+void *btrack_new(t_symbol *s, long argc, t_atom *argv)
+{
+	t_btrack *x = (t_btrack *)object_alloc(btrack_class);
+
+	if (x) {
+		dsp_setup((t_pxobject *)x, 1);	// MSP inlets: arg is # of inlets and is REQUIRED! 
+										// use 0 if you don't need inlets
+
+        object_post((t_object *) x,"v1.0     designed by Adam Stark and Matthew Davies at Queen Mary University of London");
+        
+        // create detection function and beat tracking objects
+        x->b = new BTrack();
+        
+        x->tempo_outlet = floatout(x);
+        x->beat_outlet = bangout(x);
+        
+        /*
+        
+        
+        x->mode = 0;
+        x->lastbang = 0;
+        
+        x->dobeats = 1;
+        x->countin = 4;
+        
+        x->counttempi[0] = 120;
+        x->counttempi[1] = 120;
+        x->counttempi[2] = 120;
+         */
+	}
+	return (x);
+}
+
+
+//===========================================================================
+// NOT CALLED!, we use dsp_free for a generic free function
+void btrack_free(t_btrack *x) 
+{
+	;
+}
+
+
+//===========================================================================
+void btrack_assist(t_btrack *x, void *b, long m, long a, char *s)
+{
+	if (m == ASSIST_INLET) { //inlet
+		sprintf(s, "I am inlet %ld", a);
+	} 
+	else {	// outlet
+		sprintf(s, "I am outlet %ld", a); 			
+	}
+}
+
+
+//===========================================================================
+void btrack_float(t_btrack *x, double f)
+{
+
+
+}
+
+//===========================================================================
+// this function is called when the DAC is enabled, and "registers" a function for the signal chain in Max 5 and earlier.
+// In this case we register the 32-bit, "btrack_perform" method.
+void btrack_dsp(t_btrack *x, t_signal **sp, short *count)
+{
+    int hopSize = (int) sp[0]->s_n;
+    int frameSize = hopSize*2;
+    
+    x->b->updateHopAndFrameSize(hopSize, frameSize);
+    
+	dsp_add(btrack_perform, 3, x, sp[0]->s_vec, sp[0]->s_n);
+}
+
+
+//===========================================================================
+// this is the Max 6 version of the dsp method -- it registers a function for the signal chain in Max 6,
+// which operates on 64-bit audio signals.
+void btrack_dsp64(t_btrack *x, t_object *dsp64, short *count, double samplerate, long maxvectorsize, long flags)
+{
+    int hopSize = (int) maxvectorsize;
+    int frameSize = hopSize*2;
+    
+    x->b->updateHopAndFrameSize(hopSize, frameSize);
+		
+	object_method(dsp64, gensym("dsp_add64"), x, btrack_perform64, 0, NULL);
+}
+
+
+//===========================================================================
+// this is the 32-bit perform method for Max 5 and earlier
+t_int *btrack_perform(t_int *w)
+{
+	t_btrack *x = (t_btrack *)(w[1]);
+	t_float *inL = (t_float *)(w[2]);
+	int n = (int)w[3];
+	
+    double audioFrame[n];
+    
+    for (int i = 0;i < n;i++)
+    {
+        audioFrame[i] = (double) inL[i];
+    }
+    
+    btrack_process(x,audioFrame);
+		
+	// you have to return the NEXT pointer in the array OR MAX WILL CRASH
+	return w + 4;
+}
+
+//===========================================================================
+// this is 64-bit perform method for Max 6
+void btrack_perform64(t_btrack *x, t_object *dsp64, double **ins, long numins, double **outs, long numouts, long sampleframes, long flags, void *userparam)
+{
+	t_double *inL = ins[0];		// we get audio for each inlet of the object from the **ins argument
+	int n = sampleframes;
+    
+    double audioFrame[n];
+    
+    for (int i = 0;i < n;i++)
+    {
+        audioFrame[i] = (double) inL[i];
+    }
+    
+    btrack_process(x,audioFrame);
+}
+
+//===========================================================================
+void btrack_process(t_btrack *x,double* audioFrame)
+{
+    // process the audio frame
+    x->b->processAudioFrame(audioFrame);
+    
+    
+    // if there is a beat in this frame
+    if (x->b->beatDueInCurrentFrame())
+    {
+        // outlet a beat
+        defer_low((t_object *)x, (method)outlet_beat, NULL, 0, NULL);
+    }
+}
+
+//===========================================================================
+void outlet_beat(t_btrack *x, t_symbol *s, long argc, t_atom *argv)
+{
+    // send a bang out of the beat outlet
+    outlet_bang(x->beat_outlet);
+    
+    // send the tempo out of the tempo outlet
+    outlet_float(x->tempo_outlet, (float) x->b->getCurrentTempoEstimate());
+}
+
+
+
+
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules-and-plug-ins/max-external/btrack~.xcodeproj/project.pbxproj	Mon Nov 24 11:48:08 2014 +0000
@@ -0,0 +1,264 @@
+// !$*UTF8*$!
+{
+	archiveVersion = 1;
+	classes = {
+	};
+	objectVersion = 44;
+	objects = {
+
+/* Begin PBXBuildFile section */
+		22CF119B0EE9A8250054F513 /* btrack~.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 22CF119A0EE9A8250054F513 /* btrack~.cpp */; };
+		22CF119E0EE9A82E0054F513 /* MaxAudioAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22CF119D0EE9A82E0054F513 /* MaxAudioAPI.framework */; };
+		E34F60F61A22A83400AD0770 /* BTrack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E34F60F21A22A83400AD0770 /* BTrack.cpp */; };
+		E34F60F71A22A83400AD0770 /* BTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = E34F60F31A22A83400AD0770 /* BTrack.h */; };
+		E34F60F81A22A83400AD0770 /* OnsetDetectionFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E34F60F41A22A83400AD0770 /* OnsetDetectionFunction.cpp */; };
+		E34F60F91A22A83400AD0770 /* OnsetDetectionFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = E34F60F51A22A83400AD0770 /* OnsetDetectionFunction.h */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+		22CF10220EE984600054F513 /* maxmspsdk.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = maxmspsdk.xcconfig; sourceTree = SOURCE_ROOT; };
+		22CF119A0EE9A8250054F513 /* btrack~.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "btrack~.cpp"; sourceTree = "<group>"; };
+		22CF119D0EE9A82E0054F513 /* MaxAudioAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MaxAudioAPI.framework; path = "../../../SDKs/MaxSDK-6.1.4/c74support/msp-includes/MaxAudioAPI.framework"; sourceTree = SOURCE_ROOT; };
+		2FBBEAE508F335360078DB84 /* btrack~.mxo */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "btrack~.mxo"; sourceTree = BUILT_PRODUCTS_DIR; };
+		E34F60F21A22A83400AD0770 /* BTrack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BTrack.cpp; sourceTree = "<group>"; };
+		E34F60F31A22A83400AD0770 /* BTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BTrack.h; sourceTree = "<group>"; };
+		E34F60F41A22A83400AD0770 /* OnsetDetectionFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OnsetDetectionFunction.cpp; sourceTree = "<group>"; };
+		E34F60F51A22A83400AD0770 /* OnsetDetectionFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OnsetDetectionFunction.h; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+		2FBBEADC08F335360078DB84 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				22CF119E0EE9A82E0054F513 /* MaxAudioAPI.framework in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+		089C166AFE841209C02AAC07 /* iterator */ = {
+			isa = PBXGroup;
+			children = (
+				22CF10220EE984600054F513 /* maxmspsdk.xcconfig */,
+				22CF119A0EE9A8250054F513 /* btrack~.cpp */,
+				E34F60F11A22A83400AD0770 /* src */,
+				22CF119D0EE9A82E0054F513 /* MaxAudioAPI.framework */,
+				19C28FB4FE9D528D11CA2CBB /* Products */,
+			);
+			name = iterator;
+			sourceTree = "<group>";
+		};
+		19C28FB4FE9D528D11CA2CBB /* Products */ = {
+			isa = PBXGroup;
+			children = (
+				2FBBEAE508F335360078DB84 /* btrack~.mxo */,
+			);
+			name = Products;
+			sourceTree = "<group>";
+		};
+		E34F60F11A22A83400AD0770 /* src */ = {
+			isa = PBXGroup;
+			children = (
+				E34F60F21A22A83400AD0770 /* BTrack.cpp */,
+				E34F60F31A22A83400AD0770 /* BTrack.h */,
+				E34F60F41A22A83400AD0770 /* OnsetDetectionFunction.cpp */,
+				E34F60F51A22A83400AD0770 /* OnsetDetectionFunction.h */,
+			);
+			name = src;
+			path = ../../src;
+			sourceTree = "<group>";
+		};
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+		2FBBEAD708F335360078DB84 /* Headers */ = {
+			isa = PBXHeadersBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				E34F60F91A22A83400AD0770 /* OnsetDetectionFunction.h in Headers */,
+				E34F60F71A22A83400AD0770 /* BTrack.h in Headers */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+		2FBBEAD608F335360078DB84 /* max-external */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = 2FBBEAE008F335360078DB84 /* Build configuration list for PBXNativeTarget "max-external" */;
+			buildPhases = (
+				2FBBEAD708F335360078DB84 /* Headers */,
+				2FBBEAD808F335360078DB84 /* Resources */,
+				2FBBEADA08F335360078DB84 /* Sources */,
+				2FBBEADC08F335360078DB84 /* Frameworks */,
+				2FBBEADF08F335360078DB84 /* Rez */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = "max-external";
+			productName = iterator;
+			productReference = 2FBBEAE508F335360078DB84 /* btrack~.mxo */;
+			productType = "com.apple.product-type.bundle";
+		};
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+		089C1669FE841209C02AAC07 /* Project object */ = {
+			isa = PBXProject;
+			attributes = {
+			};
+			buildConfigurationList = 2FBBEACF08F335010078DB84 /* Build configuration list for PBXProject "btrack~" */;
+			compatibilityVersion = "Xcode 3.0";
+			developmentRegion = English;
+			hasScannedForEncodings = 1;
+			knownRegions = (
+				English,
+				Japanese,
+				French,
+				German,
+			);
+			mainGroup = 089C166AFE841209C02AAC07 /* iterator */;
+			projectDirPath = "";
+			projectRoot = "";
+			targets = (
+				2FBBEAD608F335360078DB84 /* max-external */,
+			);
+		};
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+		2FBBEAD808F335360078DB84 /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXRezBuildPhase section */
+		2FBBEADF08F335360078DB84 /* Rez */ = {
+			isa = PBXRezBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXRezBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+		2FBBEADA08F335360078DB84 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				E34F60F81A22A83400AD0770 /* OnsetDetectionFunction.cpp in Sources */,
+				E34F60F61A22A83400AD0770 /* BTrack.cpp in Sources */,
+				22CF119B0EE9A8250054F513 /* btrack~.cpp in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+		2FBBEAD008F335010078DB84 /* Development */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				OTHER_LDFLAGS = (
+					"-lsamplerate",
+					"-lfftw3",
+				);
+			};
+			name = Development;
+		};
+		2FBBEAD108F335010078DB84 /* Deployment */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				OTHER_LDFLAGS = (
+					"-lsamplerate",
+					"-lfftw3",
+				);
+			};
+			name = Deployment;
+		};
+		2FBBEAE108F335360078DB84 /* Development */ = {
+			isa = XCBuildConfiguration;
+			baseConfigurationReference = 22CF10220EE984600054F513 /* maxmspsdk.xcconfig */;
+			buildSettings = {
+				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+				COPY_PHASE_STRIP = NO;
+				FRAMEWORK_SEARCH_PATHS = (
+					"$(inherited)",
+					"\"$(C74SUPPORT)/msp-includes\"",
+				);
+				GCC_OPTIMIZATION_LEVEL = 0;
+				HEADER_SEARCH_PATHS = (
+					"\"$(C74SUPPORT)/max-includes\"",
+					"\"$(C74SUPPORT)/msp-includes\"",
+					"\"$(C74SUPPORT)/jit-includes\"",
+					/usr/local/include,
+				);
+				LIBRARY_SEARCH_PATHS = /usr/local/lib;
+				OTHER_LDFLAGS = (
+					"$(C74_SYM_LINKER_FLAGS)",
+					"-lfftw3",
+					"-lsamplerate",
+				);
+				PRODUCT_NAME = "btrack~";
+			};
+			name = Development;
+		};
+		2FBBEAE208F335360078DB84 /* Deployment */ = {
+			isa = XCBuildConfiguration;
+			baseConfigurationReference = 22CF10220EE984600054F513 /* maxmspsdk.xcconfig */;
+			buildSettings = {
+				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+				COPY_PHASE_STRIP = YES;
+				FRAMEWORK_SEARCH_PATHS = (
+					"$(inherited)",
+					"\"$(C74SUPPORT)/msp-includes\"",
+				);
+				HEADER_SEARCH_PATHS = (
+					"\"$(C74SUPPORT)/max-includes\"",
+					"\"$(C74SUPPORT)/msp-includes\"",
+					"\"$(C74SUPPORT)/jit-includes\"",
+					/usr/local/include,
+				);
+				LIBRARY_SEARCH_PATHS = /usr/local/lib;
+				OTHER_LDFLAGS = (
+					"$(C74_SYM_LINKER_FLAGS)",
+					"-lfftw3",
+					"-lsamplerate",
+				);
+				PRODUCT_NAME = "btrack~";
+			};
+			name = Deployment;
+		};
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+		2FBBEACF08F335010078DB84 /* Build configuration list for PBXProject "btrack~" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				2FBBEAD008F335010078DB84 /* Development */,
+				2FBBEAD108F335010078DB84 /* Deployment */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Development;
+		};
+		2FBBEAE008F335360078DB84 /* Build configuration list for PBXNativeTarget "max-external" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				2FBBEAE108F335360078DB84 /* Development */,
+				2FBBEAE208F335360078DB84 /* Deployment */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Development;
+		};
+/* End XCConfigurationList section */
+	};
+	rootObject = 089C1669FE841209C02AAC07 /* Project object */;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules-and-plug-ins/max-external/maxmspsdk.xcconfig	Mon Nov 24 11:48:08 2014 +0000
@@ -0,0 +1,86 @@
+// Xcode target configuration settings for the Max 6 SDK
+// Used as the basis for Xcode projects to build Max externals.
+//
+// Changes to the settings in this file will be applied to all SDK examples
+// To change settings for only one of the examples, override the settings using
+// Xcode's target inspector.
+//
+// by Timothy Place
+// Copyright © 2012, Cycling '74
+
+
+// Name & Version
+PRODUCT_NAME = $(PROJECT_NAME)
+PRODUCT_VERSION = 6.1.4
+//ARCHS = i386 x86_64
+ARCHS = x86_64
+
+
+// Paths
+
+// ===========================================================================
+// NOTE: SET PATH TO YOUR C74SUPPORT FOLDER IN YOUR MAX SDK HERE
+
+C74SUPPORT = $(SRCROOT)/../../../SDKs/MaxSDK-6.1.4/c74support/
+
+// ===========================================================================
+
+HEADER_SEARCH_PATHS = "$(C74SUPPORT)/max-includes" "$(C74SUPPORT)/msp-includes" "$(C74SUPPORT)/jit-includes"
+FRAMEWORK_SEARCH_PATHS = "$(C74SUPPORT)/max-includes" "$(C74SUPPORT)/msp-includes" "$(C74SUPPORT)/jit-includes"
+DSTROOT = $(SRCROOT)/build
+// (This next path is relative to DSTROOT)
+INSTALL_PATH = /
+
+
+// Special Files
+GCC_PREFIX_HEADER = $(C74SUPPORT)/max-includes/macho-prefix.pch
+INFOPLIST_FILE = $(SRCROOT)/Info.plist
+
+
+// Architecture and Deployment
+ARCHS = i386 x86_64
+
+// The following section sets the Mac SDK version to be used.
+// For most projects this has little to no impact because there are no direct dependencies on OS function calls.
+// In those projects with OS function calls, it should be okay to use the most recent SDK version because the 
+// MACOSX_DEPLOYMENT_TARGET will disable functionality that is unavailable in the older target OS.
+// For this reason, the SDKROOT variable is commented out, telling Xcode to use the default (which is the most recent SDK).
+//
+// If you do need to define the SDKROOT, different versions of Xcode have varying syntax and varying versions of the SDK present.
+
+// Xcode 3.x
+// SDKROOT = $(DEVELOPER_DIR)/SDKs/MacOSX10.5.sdk
+
+// Xcode 4.0 - Xcode 4.2
+// SDKROOT = $(DEVELOPER_DIR)/SDKs/MacOSX10.6.sdk
+
+// Xcode 4.3+
+// SDKROOT = macosx10.6
+
+MACOSX_DEPLOYMENT_TARGET = 10.6
+
+
+// Compiler Version -- leave them all commented out to get the default version provided by Xcode
+// GCC_VERSION = 4.2
+// GCC_VERSION = com.apple.compilers.llvmgcc42
+// GCC_VERSION = com.apple.compilers.llvm.clang.1_0
+
+
+// Preprocessor Defines
+GCC_PREPROCESSOR_DEFINITIONS = "DENORM_WANT_FIX = 1" "NO_TRANSLATION_SUPPORT = 1"
+
+
+// Static Configuration (don't change these)
+WRAPPER_EXTENSION = mxo;
+WARNING_CFLAGS = -Wmost -Wno-four-char-constants -Wno-unknown-pragmas
+DEPLOYMENT_LOCATION = YES
+GENERATE_PKGINFO_FILE = YES
+
+
+// Flags to enforce some build-time checks for the symbols used while not actually performing a hard link
+C74_SYM_LINKER_FLAGS = @$(C74SUPPORT)/max-includes/c74_linker_flags.txt
+
+
+// hide all symbols by default
+// mark a function to be exported with the C74_EXPORT macro -- most likely this will only apply to the main() function
+OTHER_CFLAGS = -fvisibility=hidden
--- a/src/BTrack.cpp	Fri Nov 21 13:26:54 2014 +0000
+++ b/src/BTrack.cpp	Mon Nov 24 11:48:08 2014 +0000
@@ -165,6 +165,12 @@
 }
 
 //=======================================================================
+double BTrack::getCurrentTempoEstimate()
+{
+    return estimatedTempo;
+}
+
+//=======================================================================
 int BTrack::getHopSize()
 {
     return hopSize;