changeset 703:14b48e1b9ca4

Fix to start vector / length (ta Christophe!)
author mas01mj
date Fri, 30 Apr 2010 15:31:08 +0000
parents 6d8539709d9c
children df35c9c976a0
files examples/iAudioDB/AppController.m examples/iAudioDB/English.lproj/MainMenu.xib
diffstat 2 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/examples/iAudioDB/AppController.m	Fri Apr 30 14:57:30 2010 +0000
+++ b/examples/iAudioDB/AppController.m	Fri Apr 30 15:31:08 2010 +0000
@@ -670,7 +670,7 @@
 	{
 		if(lengthSecs >= 0)
 		{
-			lengthVectors = ceil(((lengthSecs*sampleRate)-winSize)/hopSize);
+			lengthVectors = ceil((((lengthSecs*sampleRate)-winSize)/hopSize)+1);
 			if(lengthVectors < 0) {lengthVectors = 0; }
 			[queryLengthVectors setDoubleValue:lengthVectors];
 		}
@@ -680,7 +680,7 @@
 	{
 		if(lengthVectors >= 0)
 		{
-			lengthSecs = ((hopSize*lengthVectors)+winSize)/sampleRate;
+			lengthSecs = ((hopSize*(lengthVectors-1))+winSize)/sampleRate;
 			if(lengthSecs < 0) { lengthSecs = 0; }
 			[queryLengthSeconds setDoubleValue:lengthSecs];
 		}
@@ -691,7 +691,7 @@
 	{
 		if(startSecs >= 0)
 		{
-			startVectors = ceil(((startSecs*sampleRate)-winSize)/hopSize);
+			startVectors = ceil((startSecs*sampleRate)/hopSize);
 			if(startVectors < 0) { startVectors = 0; }
 			[queryStartVectors setDoubleValue:startVectors];
 		}
@@ -700,7 +700,7 @@
 	{
 		if(startVectors >= 0)
 		{
-			startSecs = ((hopSize*startVectors)+winSize)/sampleRate;
+			startSecs = (hopSize*startVectors)/sampleRate;
 			if(startSecs < 0) { startSecs = 0; }
 			[queryStartSeconds setDoubleValue:startSecs];
 		}
--- a/examples/iAudioDB/English.lproj/MainMenu.xib	Fri Apr 30 14:57:30 2010 +0000
+++ b/examples/iAudioDB/English.lproj/MainMenu.xib	Fri Apr 30 15:31:08 2010 +0000
@@ -12,7 +12,7 @@
 			<integer value="57"/>
 			<integer value="793"/>
 			<integer value="565"/>
-			<integer value="371"/>
+			<integer value="372"/>
 		</object>
 		<object class="NSArray" key="IBDocument.PluginDependencies">
 			<bool key="EncodedWithXMLCoder">YES</bool>
@@ -3488,8 +3488,8 @@
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<reference ref="9"/>
-					<string>{{413, 516}, {305, 232}}</string>
-					<string>{{413, 516}, {305, 232}}</string>
+					<string>{{240, 433}, {305, 232}}</string>
+					<string>{{240, 433}, {305, 232}}</string>
 					<boolean value="NO" id="6"/>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>{{83, 102}, {201, 183}}</string>
@@ -3631,7 +3631,7 @@
 				</object>
 			</object>
 			<nil key="sourceID"/>
-			<int key="maxID">905</int>
+			<int key="maxID">909</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<object class="NSMutableArray" key="referencedPartialClassDescriptions">