Originally Posted by R. Belmont
BTW, these patches greatly improved NiGHTS also, except nights-2a has a weird pitch problem on the flute. Any ideas on that?

I discovered the main culprit causing this problem. The sampler should loop upon reaching LEA (loop end address), not afterwards. This caused the reading of one sample too many for each loop, lowering the pitch (especially noticeable when the loop segment is very small - see Desire example below).

Patch against AOSDK 1.1.3 (just changed some ">"s to ">="s):

Code
diff -Nru aosdk_base/eng_ssf/scsp.c aosdk/eng_ssf/scsp.c
--- aosdk_base/eng_ssf/scsp.c	2007-12-09 11:07:38.000000000 -0800
+++ aosdk/eng_ssf/scsp.c	2007-12-10 01:07:56.000000000 -0800
@@ -1147,18 +1147,18 @@
 	switch(LPCTL(slot))
 	{
 	case 0:	//no loop
-		if(addr>LEA(slot))
+		if(addr>=LEA(slot))
 		{
 			//slot->active=0;
 			SCSP_StopSlot(slot,0);
 		}
 		break;
 	case 1: //normal loop
-		if(addr>LEA(slot))
+		if(addr>=LEA(slot))
 			slot->cur_addr=LSA(slot)<<SHIFT;
 		break;
 	case 2:	//reverse loop
-		if(addr>LEA(slot))
+		if(addr>=LEA(slot))
 		{
 			slot->cur_addr=LEA(slot)<<SHIFT;
 			slot->Backwards=1;
@@ -1167,7 +1167,7 @@
 			slot->cur_addr=LEA(slot)<<SHIFT;
 		break;
 	case 3: //ping-pong
-		if(addr>LEA(slot)) //reached end, reverse till start
+		if(addr>=LEA(slot)) //reached end, reverse till start
 		{
 			slot->cur_addr=LEA(slot)<<SHIFT;
 			slot->Backwards=1;



The problem affected Desire much worse than NiGHTS. Try playing desire_09.minissf before and after the patch for comparison.

BTW, I put up rips of Guardian Force and Marica on my page (http://snesmusic.org/hoot/kingshriek/ssf/) if anyone is interested.