This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fix for distorted synthesizer sound (maybe)
#1
Starting with r1979, I noticed that sound effects in Persona 3 Portable became a bit distorted and noisy. I think I have found a way to restore the sound quality back to the way it was previously. In class jpcsp.sound.SampleSourceWithPitch starting on line 75, I changed the getSampleIndex() method to:
Code:
    @Override
    public int getSampleIndex() {
            return sampleIndex;
    }

The original one calculates the sampleIndex from the sampleSourceIndex but I'm not sure that's necessary since there's already a sampleIndex field available. The calculation probably introduces rounding errors which cause the distortion/noise? Changing the above seems to have restored sound effects quality in P3P (and probably other games too) back to the way it was before r1979.

Also, I noticed that SampleSourceWithPitch isn't needed if pitch is already at base pitch, and some sound effects in P3P (and I assume in other games too) are at base pitch. So, perhaps the following optimization in class jpcsp.sound.SoftwareSynthesizer in method getSampleSource() replacing lines 35-36 can help a bit:
Code:
ISampleSource sampleSourceTemp = new SampleSourceVAG(voice.getVAGAddress(), voice.getVAGSize(), voice.getLoopMode() != sceSasCore.PSP_SAS_LOOP_MODE_OFF);
int pitch = voice.getPitch();
if (pitch == sceSasCore.PSP_SAS_PITCH_BASE)
        sampleSource = sampleSourceTemp;
else
        sampleSource = new SampleSourceWithPitch(sampleSourceTemp, pitch);

I haven't done any benchmarks at all, and the above optimization may even be useless or even slow things down a bit if very few sounds are at base pitch in most games. Oh well, it's just a suggestion. Smile
Reply


Messages In This Thread
Fix for distorted synthesizer sound (maybe) - by Itaru - 02-26-2011, 04:57 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)