Commits

Sam Drazin committed 032f88e

4/23 changes, steadying of pulse recognition adding single bit values (not working, but there)

  • Participants
  • Parent commits af1431f
  • Branches Post_Pats_Changes

Comments (0)

Files changed (6)

File Classes/MainViewController.h

 #import <UIKit/UIKit.h>
 
 #define kUpdateInterval	(1.0f/10.0f)
-#define kMaxAccel		1.5f
-#define kMinAccel	   -1.5f
-#define	kMaxValue		255.0
-#define kMinValue		0.0
+#define kMaxAccel			1.5f
+#define kMinAccel		   -1.5f
+#define	kMaxValue			255.0
+#define kMinValue			0.0
+#define	kScreenRefreshTime	0.01
 
 @class WiiNunchuckAppDelegate;
 

File Classes/MainViewController.mm

 	[myTimer release];
 	myTimer = nil;
 	
-	myTimer = [[NSTimer timerWithTimeInterval:0.05 target:self selector:@selector(timerFired:) userInfo:nil repeats:YES] retain];
+	myTimer = [[NSTimer timerWithTimeInterval:kScreenRefreshTime target:self selector:@selector(timerFired:) userInfo:nil repeats:YES] retain];
 	[[NSRunLoop currentRunLoop] addTimer:myTimer forMode:NSDefaultRunLoopMode];	
 }
 
 		value2 = value;
 	}
 	else if (labelNumber == 3) {
-		if ([applicationDelegate->settingsViewController shouldUseiPhoneAccel])
+		if ([applicationDelegate->settingsViewController shouldUseiPhoneAccel]) {
 			value3 = iPhoneAccel;
-		else
+			printf("-- Using iPhoneAccel value for label 3");
+		}
+		else {
 			value3 = value;
+		}
 	}	
 }
 
 		[message release];
 	}
 	else {
-		value3 = 0;
-		valueLabel3.text = @"0";
+//		value3 = 0;
+//		valueLabel3.text = @"0";
 		valueLabel3Title.text = @"";
 	}
 

File Classes/SampleAudioUnit.h

 #include "Filter.h"
 
 // Describe the data stream expected from the Arduino
-#define kNumWords					2
+#define kNumWords					3
 #define kBitsPerWord				8
-#define kPacketLength				(kNumWords*kBitsPerWord)
+#define	kSingleBitWords				2
+#define kPacketLength				(kNumWords*kBitsPerWord) + kSingleBitWords
 #define kBufferSize					512
-#define kMovingAverageLength		3
-
+#define kMovingAverageLength		4
 /* Endianness declared by arbitrary constant with the following values:
 		Little Endian:	1001
 		Big Endian:		1002
 #define kBigEndian					1002
 #define kEndianness					kLittleEndian
 
-//#define kOnePulseWidth			50	//#define kZeroPulseWidth			15
-
 #define kPulseLengthThreshold		20
 #define kMinPulseLength				3
 #define kPulseThreshold				0.425
 
-//#define kWidthBetweenPulses		80	//#define kStartPacketWidth			500
 #define kInitSequenceLength			250
 
 @class WiiNunchuckAppDelegate;
     void	process(float *buffer, int numSamplesPerChannel, int numChannels);
 	char	makeAppropriatePulse(int numOnes);
     void	writePulse(char pulse);	
-	void	printValues(int wordsRecieved, double *valueBuffer[]);
+	void	printValues(int wordsReceived, double *valueBuffer[]);
 	void	adjustBinaryCounters();
 	void	updateValueBuffers(int whichValue, double value);
 	void	printStatus();
 	char					*dataWord;
 
 	int						numBitsRead;	
-	int						wordsRecieved;
+	int						wordsReceived;
+	int						singleBitsReceived;
 	int						wordCount;
 
 	int						zeroTrainLength;
 	double					value1, 
 							value2, 
 							value3;
+
+	bool					value4,
+							value5;
+
+	int						packetCount;
+	
 	int						value1count,
 							value2count, 
-							value3count;
+							value3count,
+							value4count,
+							value5count,;
+	
 	double					*value1Buffer, 
 							*value2Buffer,
 							*value3Buffer;
+	
+	bool					*value4Buffer,
+							*value5Buffer;
 /*
 	int		*accelXBuffer;
 	char	*accelYBuffer;

File Classes/SampleAudioUnit.mm

 */
 	currentBit				= '0';
 	
+	packetCount				= 0;
 	value1count				= 0;
 	value2count				= 0;
 	value3count				= 0;
+	value4count				= 0;
+	value5count				= 0;
 
 	value1					= 0;
 	value2					= 0;
 	value3					= 0;
+	value4					= 0;
+	value5					= 0;
 	
 	value1Buffer			= new double[kMovingAverageLength];
 	value2Buffer			= new double[kMovingAverageLength];
 	value3Buffer			= new double[kMovingAverageLength];
+	value4Buffer			= new bool[kMovingAverageLength];
+	value5Buffer			= new bool[kMovingAverageLength];
 	
 	frameCount				= 0;
 	zeroTrainLength			= 0;
 	oneTrainLength			= 0;
-	wordsRecieved			= 0;
+	wordsReceived			= 0;
+	singleBitsReceived		= 0;
 	wordCount				= 0;
 	numBitsRead				= 0;
 	
 	delete [] value1Buffer;
 	delete [] value2Buffer;
 	delete [] value3Buffer;
+	delete [] value4Buffer;
+	delete [] value5Buffer;
 	
 	free(applicationDelegate);
 	
 	return sum/length;
 }
 
+bool bufferAverage(bool *buffer, int length)
+{
+	if (DEBUG) NSLog(@"--bufferAverage()");
+	
+	int sum = 0;
+	for (int i = 0; i < length; i += 1)
+		sum += (int) buffer[i];
+	return (bool) sum/length;
+}
+
 /*
-void SampleAudioUnit::printValues(int wordsRecieved, double *valueBuffer[])
+void SampleAudioUnit::printValues(int wordsReceived, double *valueBuffer[])
 {	
-	for (int k = 0; k < wordsRecieved; k += 1)
+	for (int k = 0; k < wordsReceived; k += 1)
 		printf("\t\t\t");
 
 	double sum = 0;
 }
 */
 
+
+/*	This function collects all of the calculated values, and stores them in a circular buffer. 
+ *  The moving average of the kMovingAverageLength values will then be transmitted to the iPhone's display
+ *	as the accurate (average) value being transmitted.  This is an attempt to reduce data noise.
+ *
+ *  The values are transmitted in the following sequence:
+ *
+ *	Value	1		2		3		4		5
+ *  Bits	8		8		8		1		1
+ */
 void SampleAudioUnit::updateValueBuffers(int whichValue, double value)
 {
 	if (DEBUG) NSLog(@"--updateValueBuffers()");
 			[applicationDelegate updateValue:3 withValue:value3];
 		}
 	}
+	else if (whichValue == 4) {
+		value4Buffer[value4count%kMovingAverageLength] = (bool) value;
+		value4count += 1;
+		if (value4count >= kMovingAverageLength) {
+			value4 = bufferAverage(value4Buffer, kMovingAverageLength);	
+//			[applicationDelegate updateValue:4 withValue:value4];
+		}
+	}
+	else if (whichValue == 5) {
+		value5Buffer[value5count%kMovingAverageLength] = (bool) value;
+		value5count += 1;
+		if (value5count >= kMovingAverageLength) {
+			value5 = bufferAverage(value5Buffer, kMovingAverageLength);	
+//			[applicationDelegate updateValue:5 withValue:value5];
+		}
+	}
+	
+	packetCount += 1;
 }
 
 void SampleAudioUnit::writePulse(char pulse)
 	else {
 		for (int i = 0, j = 0; i < kPacketLength; i += 1, j += 1) {
 			currentWord[j] = dataWord[i];
-//			printf("%c", currentWord[j]);
+			
+			// If we've received all of the 8 bit words, get ready to extract the next two bits (single bit values)
+			if (wordsReceived >= kNumWords) {
+				updateValueBuffers(wordsReceived+(singleBitsReceived+1), (bool) currentWord[j]);
+				singleBitsReceived += 1;
+			}
 			
 			if ((j+1) == kBitsPerWord) {
-				
 				value = binaryStringToDecimal_BigEndian(currentWord, kBitsPerWord);		
-				wordsRecieved += 1;
+				wordsReceived += 1;
 				wordCount += 1;
 
 				// Sends the computed value to a buffer containing the past kMovingAverageLength values for that word
-				updateValueBuffers(wordsRecieved, value);
+				updateValueBuffers(wordsReceived, value);
 				
 				j = -1;
 			}
 		// Expexts a span of zeros >= length of kInitSequenceLength to begin each packet, hence: 
 		// only sets readingBits to false when a complete packet has been read
 				
-		//NSLog(@"-- wordsRecieved: %d", wordsRecieved);
+		//NSLog(@"-- wordsReceived: %d", wordsReceived);
 		
-		if (wordsRecieved == kNumWords) {
+		if (wordsReceived == kNumWords && singleBitsReceived == kSingleBitWords) {
 			readingBits = false;
-			wordsRecieved = 0;
+			wordsReceived = 0;
+			singleBitsReceived = 0;
 		}
 	}
 
 	int i;
 	char pulse;
 //	bool foundError = false;
-	//printStatus();
 	
 	for(i = 0; i < kBufferSize; i += 1)	/*numSamplesPerChannel*numChannels+1*/
 	{
 //				foundError = true;
 //				continue;
 //			}
-*/
-			//NSLog(@"> inside if(1)\t\tcB:%c, zeros(%d) at index: %d", currentBit, zeroTrainLength, i);
-			
+*/			
 			if ((zeroTrainLength > kInitSequenceLength) || readingBits) {
-				//NSLog(@">> inside if(2)\t\tcB:%c at index: %d", currentBit, i);
-
 				readingBits = true;
 
 				if ((currentBit == '0') && (oneTrainLength > zeroTrainLength) && (oneTrainLength > kMinPulseLength)) {
-					//NSLog(@">>> inside if(3)\t\tcB:%c, ones(%d) at index: %d", currentBit, oneTrainLength, i);
 					pulse = makeAppropriatePulse(oneTrainLength);
 					writePulse(pulse);
 				}
 //		foundError = false;
 	}
 	
-//	printf("\n\n");
+	if (PRINT_BINARY_VALUES)	printf("\n\n");
 
 	frameCount += 1;
 	if (frameCount % 1000 == 0)
 	printf("\n----- Status of Members -----");
 	printf("\n currentBit:    %c", currentBit);
 	printf("\n numBitsRead:   %d", numBitsRead);
-	printf("\n wordsRecieved: %d", wordsRecieved);
+	printf("\n wordsReceived: %d", wordsReceived);
 	printf("\n wordCount:     %d", wordCount);
 	printf("\n-----------------------------");
 }

File WiiNunchuck.xcodeproj/sdrazin.mode1v3

 										<key>_historyCapacity</key>
 										<integer>0</integer>
 										<key>bookmark</key>
-										<string>F448495C1181346B0027B464</string>
+										<string>F4BB7D8B118213F100AF1346</string>
 										<key>history</key>
 										<array>
 											<string>F425BBA811724FFD00D8A1F4</string>
 											<string>F41258AA11800405001DACC4</string>
 											<string>F435E8601180C70F004E7CE0</string>
 											<string>F449EB321180D94A00129758</string>
-											<string>F44849531181346B0027B464</string>
 											<string>F44849541181346B0027B464</string>
 											<string>F44849551181346B0027B464</string>
-											<string>F44849561181346B0027B464</string>
-											<string>F44849571181346B0027B464</string>
 											<string>F44849581181346B0027B464</string>
 											<string>F44849591181346B0027B464</string>
-											<string>F448495A1181346B0027B464</string>
-											<string>F448495B1181346B0027B464</string>
+											<string>F4BB7D81118213F100AF1346</string>
+											<string>F4BB7D82118213F100AF1346</string>
+											<string>F4BB7D83118213F100AF1346</string>
+											<string>F4BB7D84118213F100AF1346</string>
+											<string>F4BB7D85118213F100AF1346</string>
 										</array>
 									</dict>
 									<key>SplitCount</key>
 							<key>GeometryConfiguration</key>
 							<dict>
 								<key>Frame</key>
-								<string>{{0, 0}, {1056, 480}}</string>
+								<string>{{0, 0}, {1056, 473}}</string>
 								<key>RubberWindowFrame</key>
 								<string>34 104 1306 768 0 0 1440 878 </string>
 							</dict>
 							<key>Module</key>
 							<string>PBXNavigatorGroup</string>
 							<key>Proportion</key>
-							<string>480pt</string>
+							<string>473pt</string>
 						</dict>
 						<dict>
 							<key>ContentConfiguration</key>
 							<key>GeometryConfiguration</key>
 							<dict>
 								<key>Frame</key>
-								<string>{{0, 485}, {1056, 242}}</string>
+								<string>{{0, 478}, {1056, 249}}</string>
 								<key>RubberWindowFrame</key>
 								<string>34 104 1306 768 0 0 1440 878 </string>
 							</dict>
 							<key>Module</key>
 							<string>XCDetailModule</string>
 							<key>Proportion</key>
-							<string>242pt</string>
+							<string>249pt</string>
 						</dict>
 					</array>
 					<key>Proportion</key>
 			</array>
 			<key>TableOfContents</key>
 			<array>
-				<string>F448495D1181346B0027B464</string>
+				<string>F4BB7D87118213F100AF1346</string>
 				<string>1CE0B1FE06471DED0097A5F4</string>
-				<string>F448495E1181346B0027B464</string>
+				<string>F4BB7D88118213F100AF1346</string>
 				<string>1CE0B20306471E060097A5F4</string>
 				<string>1CE0B20506471E060097A5F4</string>
 			</array>
 	<integer>5</integer>
 	<key>WindowOrderList</key>
 	<array>
-		<string>F448495F1181346B0027B464</string>
-		<string>F44849601181346B0027B464</string>
-		<string>1C78EAAD065D492600B07095</string>
+		<string>F4BB7D89118213F100AF1346</string>
+		<string>F4BB7D8A118213F100AF1346</string>
 		<string>1CD10A99069EF8BA00B06720</string>
 		<string>F425BAEF1172444200D8A1F4</string>
+		<string>1C78EAAD065D492600B07095</string>
 		<string>/Users/sdrazin/Documents/Programs/iPhone/WiiNunchuck/WiiNunchuck.xcodeproj</string>
 	</array>
 	<key>WindowString</key>
 			<key>TableOfContents</key>
 			<array>
 				<string>F425BAEF1172444200D8A1F4</string>
-				<string>F448491911812D3D0027B464</string>
+				<string>F4BB7D3A118135E000AF1346</string>
 				<string>1CD0528F0623707200166675</string>
 				<string>XCMainBuildResultsModuleGUID</string>
 			</array>
 			<key>TableOfContents</key>
 			<array>
 				<string>1CD10A99069EF8BA00B06720</string>
-				<string>F448491A11812D3D0027B464</string>
+				<string>F4BB7D3B118135E000AF1346</string>
 				<string>1C162984064C10D400B95A72</string>
-				<string>F448491B11812D3D0027B464</string>
-				<string>F448491C11812D3D0027B464</string>
-				<string>F448491D11812D3D0027B464</string>
-				<string>F448491E11812D3D0027B464</string>
-				<string>F448491F11812D3D0027B464</string>
+				<string>F4BB7D3C118135E000AF1346</string>
+				<string>F4BB7D3D118135E000AF1346</string>
+				<string>F4BB7D3E118135E000AF1346</string>
+				<string>F4BB7D3F118135E000AF1346</string>
+				<string>F4BB7D40118135E000AF1346</string>
 			</array>
 			<key>ToolbarConfiguration</key>
 			<string>xcode.toolbar.config.debugV3</string>
 							<key>GeometryConfiguration</key>
 							<dict>
 								<key>Frame</key>
-								<string>{{0, 0}, {777, 742}}</string>
+								<string>{{0, 0}, {664, 752}}</string>
 								<key>RubberWindowFrame</key>
-								<string>638 74 777 783 0 0 1440 878 </string>
+								<string>738 80 664 793 0 0 1440 878 </string>
 							</dict>
 							<key>Module</key>
 							<string>PBXDebugCLIModule</string>
 							<key>Proportion</key>
-							<string>742pt</string>
+							<string>752pt</string>
 						</dict>
 					</array>
 					<key>Proportion</key>
-					<string>742pt</string>
+					<string>752pt</string>
 				</dict>
 			</array>
 			<key>Name</key>
 			<key>TableOfContents</key>
 			<array>
 				<string>1C78EAAD065D492600B07095</string>
-				<string>F448492011812D3D0027B464</string>
+				<string>F4BB7D41118135E000AF1346</string>
 				<string>1C78EAAC065D492600B07095</string>
 			</array>
 			<key>ToolbarConfiguration</key>
 			<string>xcode.toolbar.config.consoleV3</string>
 			<key>WindowString</key>
-			<string>638 74 777 783 0 0 1440 878 </string>
+			<string>738 80 664 793 0 0 1440 878 </string>
 			<key>WindowToolGUID</key>
 			<string>1C78EAAD065D492600B07095</string>
 			<key>WindowToolIsVisible</key>
-			<false/>
+			<true/>
 		</dict>
 		<dict>
 			<key>Identifier</key>

File WiiNunchuck.xcodeproj/sdrazin.pbxuser

 			1D6058900D05DD3D006BFB54 /* WiiNunchuck */,
 		);
 		breakpoints = (
+			F4BB7D621182112700AF1346 /* SampleAudioUnit.mm:331 */,
+			F4BB7D641182112D00AF1346 /* SampleAudioUnit.mm:329 */,
+			F4BB7D661182113100AF1346 /* SampleAudioUnit.mm:352 */,
+			F4BB7D681182113600AF1346 /* SampleAudioUnit.mm:325 */,
+			F4FFF7C211821439000D9C7B /* SampleAudioUnit.mm:322 */,
+			F4FFF7DB118215BF000D9C7B /* SampleAudioUnit.mm:353 */,
 		);
 		codeSenseManager = F425BACB1172404300D8A1F4 /* Code sense */;
 		executables = (
 					PBXFileDataSource_Warnings_ColumnID,
 				);
 			};
-			PBXPerProjectTemplateStateSaveDate = 293680243;
-			PBXWorkspaceStateSaveDate = 293680243;
+			PBXPerProjectTemplateStateSaveDate = 293737469;
+			PBXWorkspaceStateSaveDate = 293737469;
 		};
 		perUserProjectItems = {
 			F409004A11741F2F00A42609 = F409004A11741F2F00A42609 /* PBXTextBookmark */;
 			F42837101175313A00885608 = F42837101175313A00885608 /* PBXTextBookmark */;
 			F42837121175313A00885608 = F42837121175313A00885608 /* PBXTextBookmark */;
 			F435E8601180C70F004E7CE0 = F435E8601180C70F004E7CE0 /* PBXTextBookmark */;
-			F44849531181346B0027B464 = F44849531181346B0027B464 /* PBXTextBookmark */;
 			F44849541181346B0027B464 = F44849541181346B0027B464 /* PBXTextBookmark */;
 			F44849551181346B0027B464 = F44849551181346B0027B464 /* PBXTextBookmark */;
-			F44849561181346B0027B464 = F44849561181346B0027B464 /* PBXTextBookmark */;
-			F44849571181346B0027B464 = F44849571181346B0027B464 /* PBXTextBookmark */;
 			F44849581181346B0027B464 = F44849581181346B0027B464 /* PBXTextBookmark */;
 			F44849591181346B0027B464 = F44849591181346B0027B464 /* PBXTextBookmark */;
-			F448495A1181346B0027B464 = F448495A1181346B0027B464 /* PBXTextBookmark */;
-			F448495B1181346B0027B464 = F448495B1181346B0027B464 /* PBXTextBookmark */;
-			F448495C1181346B0027B464 = F448495C1181346B0027B464 /* PBXTextBookmark */;
 			F449EB321180D94A00129758 = F449EB321180D94A00129758 /* PBXTextBookmark */;
 			F4548EC4117EB3790023F7A5 = F4548EC4117EB3790023F7A5 /* PBXBookmark */;
 			F4548EC5117EB3790023F7A5 = F4548EC5117EB3790023F7A5 /* PBXBookmark */;
 			F4841F6B1173CFAF0034AF4B = F4841F6B1173CFAF0034AF4B /* PBXTextBookmark */;
 			F4841F6C1173CFAF0034AF4B = F4841F6C1173CFAF0034AF4B /* PBXTextBookmark */;
 			F4A465751178234500032E75 = F4A465751178234500032E75 /* PBXBookmark */;
+			F4BB7D81118213F100AF1346 = F4BB7D81118213F100AF1346 /* PBXTextBookmark */;
+			F4BB7D82118213F100AF1346 = F4BB7D82118213F100AF1346 /* PBXTextBookmark */;
+			F4BB7D83118213F100AF1346 = F4BB7D83118213F100AF1346 /* PBXTextBookmark */;
+			F4BB7D84118213F100AF1346 = F4BB7D84118213F100AF1346 /* PBXTextBookmark */;
+			F4BB7D85118213F100AF1346 = F4BB7D85118213F100AF1346 /* PBXTextBookmark */;
+			F4BB7D8B118213F100AF1346 = F4BB7D8B118213F100AF1346 /* PBXTextBookmark */;
 			F4F69B19117545FA00CBAF6E = F4F69B19117545FA00CBAF6E /* PBXTextBookmark */;
 			F4F69B1A117545FA00CBAF6E = F4F69B1A117545FA00CBAF6E /* PBXTextBookmark */;
 			F4F69B981176572E00CBAF6E = F4F69B981176572E00CBAF6E /* PBXTextBookmark */;
 	};
 	F425BACC1172406900D8A1F4 /* MainViewController.h */ = {
 		uiCtxt = {
-			sepNavIntBoundsRect = "{{0, 0}, {995, 741}}";
-			sepNavSelRange = "{1300, 12}";
-			sepNavVisRange = "{450, 1103}";
+			sepNavIntBoundsRect = "{{0, 0}, {995, 832}}";
+			sepNavSelRange = "{318, 18}";
+			sepNavVisRange = "{0, 790}";
 			sepNavWindowFrame = "{{38, 28}, {1357, 824}}";
 		};
 	};
 	F425BACD1172406900D8A1F4 /* MainViewController.mm */ = {
 		uiCtxt = {
-			sepNavFolds = "{\n    c =     (\n                {\n            r = \"{520, 78}\";\n            s = 0;\n        },\n                {\n            r = \"{716, 155}\";\n            s = 0;\n        },\n                {\n            r = \"{917, 710}\";\n            s = 0;\n        },\n                {\n            r = \"{1653, 320}\";\n            s = 0;\n        },\n                {\n            r = \"{2006, 400}\";\n            s = 0;\n        },\n                {\n            r = \"{2477, 257}\";\n            s = 0;\n        },\n                {\n            r = \"{2774, 81}\";\n            s = 0;\n        },\n                {\n            r = \"{2979, 1116}\";\n            s = 0;\n        },\n                {\n            r = \"{4100, 221}\";\n            s = 0;\n        },\n                {\n            r = \"{4324, 112}\";\n            s = 0;\n        },\n                {\n            r = \"{4439, 292}\";\n            s = 0;\n        },\n                {\n            r = \"{4767, 155}\";\n            s = 0;\n        },\n                {\n            r = \"{4948, 83}\";\n            s = 0;\n        }\n    );\n    r = \"{0, 5082}\";\n    s = 0;\n}";
-			sepNavIntBoundsRect = "{{0, 0}, {995, 832}}";
-			sepNavSelRange = "{687, 0}";
-			sepNavVisRange = "{247, 741}";
+			sepNavFolds = "{\n    c =     (\n                {\n            r = \"{520, 78}\";\n            s = 0;\n        },\n                {\n            r = \"{716, 155}\";\n            s = 0;\n        },\n                {\n            r = \"{917, 724}\";\n            s = 0;\n        },\n                {\n            r = \"{1667, 320}\";\n            s = 0;\n        },\n                {\n            r = \"{2853, 81}\";\n            s = 0;\n        },\n                {\n            r = \"{3058, 1120}\";\n            s = 0;\n        },\n                {\n            r = \"{4183, 221}\";\n            s = 0;\n        },\n                {\n            r = \"{4407, 112}\";\n            s = 0;\n        },\n                {\n            r = \"{4522, 292}\";\n            s = 0;\n        },\n                {\n            r = \"{4850, 155}\";\n            s = 0;\n        },\n                {\n            r = \"{5031, 83}\";\n            s = 0;\n        }\n    );\n    r = \"{0, 5165}\";\n    s = 0;\n}";
+			sepNavIntBoundsRect = "{{0, 0}, {995, 1209}}";
+			sepNavSelRange = "{1706, 0}";
+			sepNavVisRange = "{1316, 519}";
 			sepNavWindowFrame = "{{15, 49}, {1357, 824}}";
 		};
 	};
 	};
 	F425BBCD117251D500D8A1F4 /* SampleAudioUnit.mm */ = {
 		uiCtxt = {
-			sepNavFolds = "{\n    c =     (\n                {\n            c =             (\n                                {\n                    r = \"{398, 302}\";\n                    s = 0;\n                },\n                                {\n                    r = \"{772, 132}\";\n                    s = 0;\n                },\n                                {\n                    r = \"{910, 219}\";\n                    s = 0;\n                }\n            );\n            r = \"{281, 1429}\";\n            s = 0;\n        },\n                {\n            r = \"{1750, 277}\";\n            s = 0;\n        },\n                {\n            r = \"{2078, 230}\";\n            s = 0;\n        },\n                {\n            r = \"{2379, 280}\";\n            s = 0;\n        },\n                {\n            r = \"{2718, 61}\";\n            s = 0;\n        },\n                {\n            r = \"{2805, 25}\";\n            s = 0;\n        },\n                {\n            r = \"{2904, 257}\";\n            s = 0;\n        },\n                {\n            r = \"{3238, 161}\";\n            s = 0;\n        },\n                {\n            r = \"{3461, 664}\";\n            s = 0;\n        },\n                {\n            r = \"{4178, 138}\";\n            s = 0;\n        },\n                {\n            r = \"{4320, 583}\";\n            s = 0;\n        },\n                {\n            r = \"{4978, 1035}\";\n            s = 0;\n        },\n                {\n            r = \"{6062, 1090}\";\n            s = 0;\n        },\n                {\n            r = \"{7212, 184}\";\n            s = 0;\n        },\n                {\n            r = \"{7445, 157}\";\n            s = 0;\n        },\n                {\n            c =             (\n                                {\n                    r = \"{8078, 688}\";\n                    s = 0;\n                },\n                                {\n                    r = \"{8945, 158}\";\n                    s = 0;\n                }\n            );\n            r = \"{7694, 2186}\";\n            s = 0;\n        },\n                {\n            r = \"{9920, 272}\";\n            s = 0;\n        }\n    );\n    r = \"{0, 10194}\";\n    s = 0;\n}";
-			sepNavIntBoundsRect = "{{0, 0}, {995, 780}}";
-			sepNavSelRange = "{127, 0}";
-			sepNavVisRange = "{510, 668}";
+			sepNavFolds = "{\n    c =     (\n                {\n            c =             (\n                                {\n                    r = \"{398, 302}\";\n                    s = 0;\n                },\n                                {\n                    r = \"{772, 132}\";\n                    s = 0;\n                },\n                                {\n                    r = \"{910, 219}\";\n                    s = 0;\n                }\n            );\n            r = \"{281, 1652}\";\n            s = 0;\n        },\n                {\n            r = \"{1973, 327}\";\n            s = 0;\n        },\n                {\n            r = \"{2351, 230}\";\n            s = 0;\n        },\n                {\n            r = \"{2652, 280}\";\n            s = 0;\n        },\n                {\n            r = \"{2991, 61}\";\n            s = 0;\n        },\n                {\n            r = \"{3078, 25}\";\n            s = 0;\n        },\n                {\n            r = \"{3177, 257}\";\n            s = 0;\n        },\n                {\n            r = \"{3511, 161}\";\n            s = 0;\n        },\n                {\n            r = \"{3734, 664}\";\n            s = 0;\n        },\n                {\n            r = \"{4451, 138}\";\n            s = 0;\n        },\n                {\n            r = \"{4638, 148}\";\n            s = 0;\n        },\n                {\n            r = \"{4790, 583}\";\n            s = 0;\n        },\n                {\n            r = \"{5861, 1634}\";\n            s = 0;\n        },\n                {\n            r = \"{7544, 1385}\";\n            s = 0;\n        },\n                {\n            r = \"{8989, 184}\";\n            s = 0;\n        },\n                {\n            r = \"{9222, 157}\";\n            s = 0;\n        },\n                {\n            r = \"{9837, 688}\";\n            s = 0;\n        },\n                {\n            r = \"{10704, 158}\";\n            s = 0;\n        }\n    );\n    r = \"{0, 11710}\";\n    s = 0;\n}";
+			sepNavIntBoundsRect = "{{0, 0}, {995, 1456}}";
+			sepNavSelRange = "{2527, 0}";
+			sepNavVisRange = "{2146, 850}";
 			sepNavWindowFrame = "{{15, 49}, {1357, 824}}";
 		};
 	};
 	F425BBCE117251D500D8A1F4 /* SampleAudioUnit.h */ = {
 		uiCtxt = {
-			sepNavFolds = "{\n    c =     (\n                {\n            r = \"{297, 114}\";\n            s = 0;\n        },\n                {\n            r = \"{1735, 266}\";\n            s = 0;\n        }\n    );\n    r = \"{0, 2041}\";\n    s = 0;\n}";
-			sepNavIntBoundsRect = "{{0, 0}, {995, 936}}";
-			sepNavSelRange = "{492, 0}";
-			sepNavVisRange = "{0, 908}";
+			sepNavFolds = "{\n    c =     (\n                {\n            r = \"{343, 114}\";\n            s = 0;\n        },\n                {\n            c =             (\n                                {\n                    r = \"{1834, 266}\";\n                    s = 0;\n                }\n            );\n            r = \"{765, 1372}\";\n            s = 0;\n        }\n    );\n    r = \"{0, 2140}\";\n    s = 0;\n}";
+			sepNavIntBoundsRect = "{{0, 0}, {995, 434}}";
+			sepNavSelRange = "{638, 12}";
+			sepNavVisRange = "{0, 656}";
 			sepNavWindowFrame = "{{15, 49}, {1357, 824}}";
 		};
 	};
 		vrLen = 358;
 		vrLoc = 0;
 	};
-	F44849531181346B0027B464 /* PBXTextBookmark */ = {
-		isa = PBXTextBookmark;
-		fRef = 1D3623240D0F684500981E51 /* WiiNunchuckAppDelegate.h */;
-		name = "WiiNunchuckAppDelegate.h: 24";
-		rLen = 0;
-		rLoc = 630;
-		rType = 0;
-		vrLen = 854;
-		vrLoc = 0;
-	};
 	F44849541181346B0027B464 /* PBXTextBookmark */ = {
 		isa = PBXTextBookmark;
 		fRef = 1D3623250D0F684500981E51 /* WiiNunchuckAppDelegate.mm */;
 		vrLen = 715;
 		vrLoc = 0;
 	};
-	F44849561181346B0027B464 /* PBXTextBookmark */ = {
-		isa = PBXTextBookmark;
-		fRef = F425BACC1172406900D8A1F4 /* MainViewController.h */;
-		name = "MainViewController.h: 47";
-		rLen = 12;
-		rLoc = 1300;
-		rType = 0;
-		vrLen = 1103;
-		vrLoc = 450;
-	};
-	F44849571181346B0027B464 /* PBXTextBookmark */ = {
-		isa = PBXTextBookmark;
-		fRef = F425BACD1172406900D8A1F4 /* MainViewController.mm */;
-		name = "MainViewController.mm: 59";
-		rLen = 0;
-		rLoc = 1627;
-		rType = 0;
-		vrLen = 3850;
-		vrLoc = 247;
-	};
 	F44849581181346B0027B464 /* PBXTextBookmark */ = {
 		isa = PBXTextBookmark;
 		fRef = F425BAD01172407600D8A1F4 /* SettingsViewController.mm */;
 		vrLen = 233;
 		vrLoc = 0;
 	};
-	F448495A1181346B0027B464 /* PBXTextBookmark */ = {
-		isa = PBXTextBookmark;
-		fRef = F425BBCE117251D500D8A1F4 /* SampleAudioUnit.h */;
-		name = "SampleAudioUnit.h: 22";
-		rLen = 0;
-		rLoc = 605;
-		rType = 0;
-		vrLen = 1021;
-		vrLoc = 0;
-	};
-	F448495B1181346B0027B464 /* PBXTextBookmark */ = {
-		isa = PBXTextBookmark;
-		fRef = F425BBCD117251D500D8A1F4 /* SampleAudioUnit.mm */;
-		name = "SampleAudioUnit.mm: 397";
-		rLen = 0;
-		rLoc = 9749;
-		rType = 0;
-		vrLen = 2151;
-		vrLoc = 7843;
-	};
-	F448495C1181346B0027B464 /* PBXTextBookmark */ = {
-		isa = PBXTextBookmark;
-		fRef = F425BBCD117251D500D8A1F4 /* SampleAudioUnit.mm */;
-		name = "SampleAudioUnit.mm: 6";
-		rLen = 0;
-		rLoc = 127;
-		rType = 0;
-		vrLen = 7412;
-		vrLoc = 2782;
-	};
 	F449EB321180D94A00129758 /* PBXTextBookmark */ = {
 		isa = PBXTextBookmark;
 		fRef = F41158691178CE190082BD37 /* SineMaker.m */;
 		isa = PBXBookmark;
 		fRef = F425BB0E1172466000D8A1F4 /* wii_nunchuk.png */;
 	};
+	F4BB7D621182112700AF1346 /* SampleAudioUnit.mm:331 */ = {
+		isa = PBXFileBreakpoint;
+		actions = (
+		);
+		breakpointStyle = 0;
+		continueAfterActions = 0;
+		countType = 0;
+		delayBeforeContinue = 0;
+		fileReference = F425BBCD117251D500D8A1F4 /* SampleAudioUnit.mm */;
+		functionName = "SampleAudioUnit::writePulse(char pulse)";
+		hitCount = 2;
+		ignoreCount = 0;
+		lineNumber = 331;
+		location = WiiNunchuck;
+		modificationTime = 293737904.678785;
+		originalNumberOfMultipleMatches = 1;
+		state = 1;
+	};
+	F4BB7D641182112D00AF1346 /* SampleAudioUnit.mm:329 */ = {
+		isa = PBXFileBreakpoint;
+		actions = (
+		);
+		breakpointStyle = 0;
+		continueAfterActions = 0;
+		countType = 0;
+		delayBeforeContinue = 0;
+		fileReference = F425BBCD117251D500D8A1F4 /* SampleAudioUnit.mm */;
+		functionName = "SampleAudioUnit::writePulse(char pulse)";
+		hitCount = 26;
+		ignoreCount = 0;
+		lineNumber = 329;
+		location = WiiNunchuck;
+		modificationTime = 293737902.511542;
+		originalNumberOfMultipleMatches = 1;
+		state = 1;
+	};
+	F4BB7D661182113100AF1346 /* SampleAudioUnit.mm:352 */ = {
+		isa = PBXFileBreakpoint;
+		actions = (
+		);
+		breakpointStyle = 0;
+		continueAfterActions = 0;
+		countType = 0;
+		delayBeforeContinue = 0;
+		fileReference = F425BBCD117251D500D8A1F4 /* SampleAudioUnit.mm */;
+		functionName = "SampleAudioUnit::writePulse(char pulse)";
+		hitCount = 1;
+		ignoreCount = 0;
+		lineNumber = 352;
+		location = WiiNunchuck;
+		modificationTime = 293737913.262775;
+		originalNumberOfMultipleMatches = 1;
+		state = 1;
+	};
+	F4BB7D681182113600AF1346 /* SampleAudioUnit.mm:325 */ = {
+		isa = PBXFileBreakpoint;
+		actions = (
+		);
+		breakpointStyle = 0;
+		continueAfterActions = 0;
+		countType = 0;
+		delayBeforeContinue = 0;
+		fileReference = F425BBCD117251D500D8A1F4 /* SampleAudioUnit.mm */;
+		functionName = "SampleAudioUnit::writePulse(char pulse)";
+		hitCount = 2;
+		ignoreCount = 0;
+		lineNumber = 325;
+		location = WiiNunchuck;
+		modificationTime = 293737928.240374;
+		originalNumberOfMultipleMatches = 1;
+		state = 1;
+	};
+	F4BB7D81118213F100AF1346 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = F425BACD1172406900D8A1F4 /* MainViewController.mm */;
+		name = "MainViewController.mm: 168";
+		rLen = 0;
+		rLoc = 4178;
+		rType = 0;
+		vrLen = 2576;
+		vrLoc = 2589;
+	};
+	F4BB7D82118213F100AF1346 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = F425BACC1172406900D8A1F4 /* MainViewController.h */;
+		name = "MainViewController.h: 16";
+		rLen = 18;
+		rLoc = 318;
+		rType = 0;
+		vrLen = 790;
+		vrLoc = 0;
+	};
+	F4BB7D83118213F100AF1346 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 1D3623240D0F684500981E51 /* WiiNunchuckAppDelegate.h */;
+		name = "WiiNunchuckAppDelegate.h: 24";
+		rLen = 0;
+		rLoc = 630;
+		rType = 0;
+		vrLen = 854;
+		vrLoc = 0;
+	};
+	F4BB7D84118213F100AF1346 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = F425BBCE117251D500D8A1F4 /* SampleAudioUnit.h */;
+		name = "SampleAudioUnit.h: 8";
+		rLen = 0;
+		rLoc = 212;
+		rType = 0;
+		vrLen = 2143;
+		vrLoc = 0;
+	};
+	F4BB7D85118213F100AF1346 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = F425BBCD117251D500D8A1F4 /* SampleAudioUnit.mm */;
+		name = "SampleAudioUnit.mm: 334";
+		rLen = 0;
+		rLoc = 8227;
+		rType = 0;
+		vrLen = 1079;
+		vrLoc = 7819;
+	};
+	F4BB7D8B118213F100AF1346 /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = F425BBCD117251D500D8A1F4 /* SampleAudioUnit.mm */;
+		name = "SampleAudioUnit.mm: 329";
+		rLen = 155;
+		rLoc = 8036;
+		rType = 0;
+		vrLen = 1034;
+		vrLoc = 7925;
+	};
 	F4F69B19117545FA00CBAF6E /* PBXTextBookmark */ = {
 		isa = PBXTextBookmark;
 		fRef = F425BBBF117251CC00D8A1F4 /* AudioBasics.cpp */;
 		vrLen = 2225;
 		vrLoc = 6630;
 	};
+	F4FFF7C211821439000D9C7B /* SampleAudioUnit.mm:322 */ = {
+		isa = PBXFileBreakpoint;
+		actions = (
+		);
+		breakpointStyle = 0;
+		continueAfterActions = 0;
+		countType = 0;
+		delayBeforeContinue = 0;
+		fileReference = F425BBCD117251D500D8A1F4 /* SampleAudioUnit.mm */;
+		functionName = "SampleAudioUnit::writePulse(char pulse)";
+		hitCount = 0;
+		ignoreCount = 0;
+		lineNumber = 322;
+		location = WiiNunchuck;
+		modificationTime = 293737863.95235;
+		originalNumberOfMultipleMatches = 1;
+		state = 2;
+	};
+	F4FFF7DB118215BF000D9C7B /* SampleAudioUnit.mm:353 */ = {
+		isa = PBXFileBreakpoint;
+		actions = (
+		);
+		breakpointStyle = 0;
+		continueAfterActions = 0;
+		countType = 0;
+		delayBeforeContinue = 0;
+		fileReference = F425BBCD117251D500D8A1F4 /* SampleAudioUnit.mm */;
+		functionName = "SampleAudioUnit::writePulse(char pulse)";
+		hitCount = 1;
+		ignoreCount = 0;
+		lineNumber = 353;
+		location = WiiNunchuck;
+		modificationTime = 293737926.161759;
+		originalNumberOfMultipleMatches = 1;
+		state = 1;
+	};
 }