-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sas: Correct delay in playing samples #11097
Conversation
Nice! So much good stuff to merge now after 1.6 is done :) |
tekken 5 has problem with this PR. bgm and sound volume. |
Does it happen with only the first commit? Does it happen if you change Any impact to volume should mean an issue with ADSR. -[Unknown] |
|
Hm. Might need to log what it's sending. Maybe it rounds up or something, when the size is uneven? -[Unknown] |
It'd be useful to know what Does it help to change I can revert that last commit to get the rest merged, but just wondering what's happening that the volume would go down... -[Unknown] |
|
We still need to walk during the delay to "use it up." Need to test more to see if we can just walk once directly into ATTACK - might depend on pitch. This also makes the first play ignore the resampleHist, which matches samples to tests properly, and ignores linear interp for exact pitch. These changes fix all the sascore tests that used to work.
Not sure why everything is negative one indexed, but this prevents reading beyond the size of the buffer. This shouldn't change sound output, but it may fix a crash if VAG is at the edge of memory (unlikely, though.)
b9dc7fc
to
289928a
Compare
Got it - I see where I messed up now. Once Does it work now? -[Unknown] |
it works. |
Looks good to me. |
After #8950 (I think, didn't double check), we stopped passing the various tests for sceSas.
This was mainly because the key on delay was applied twice (
delay
andSTATE_KEYON_STEP
.) I think we can removeSTATE_KEYON_STEP
maybe, but haven't checked the pitch behavior carefully. This makes it walk the curve during the delay, playing audio 32 samples earlier (a bit under a millisecond.)This also avoids the resampleHist delay for the first render (we already have
delay
after all), which makes it align neatly to tests. They all pass again.Lastly, I discovered while testing that we were decoding uninitialized memory during the test. We set 0x100 bytes of generated VAG data (16 blocks), yet it decoded 17 blocks - and one of them made no sense. Now it ends after it reads the last block inside size.
Played some VAG music, voices, and sound effects and they sound good to me - but I don't have the best ear.
-[Unknown]