Page 1 of 2

Audio Timing

PostPosted: Mon Nov 11, 2019 9:57 am
by Jiterdomer
While me, Ian, and Conversus Vans were discussing about using MAME's SCSP code in Discord, I'd just let you share with you here that is it a good idea to use MAME's code to fix some problems like Scud Race's SCSP music speed and Harley Davidson's reverb?

Re: SCSP Patch

PostPosted: Mon Nov 11, 2019 3:04 pm
by Ian
it would probably make sense to just port mames code over

Re: SCSP Patch

PostPosted: Wed Dec 04, 2019 5:09 pm
by Conversus W. Vans
Over the past week, I spent some time figuring out why the timers were so off on games like Scud Race and others. Many of the timer functions were set to use only one SCSP chip, where Model 3 is supposed to use two. I ported a handful of code from MAME and Audio Overload as well (like EG fixes), which has fixed many musical keyoff problems.

Also I removed a lot of code that seemed useless, like the REVERB_DIF stuff and functions such as TimersAddTicks2. The music in most games should now play close to what is heard on real arcade hardware! Unfortunately, there is still the one issue with VF3 where there's too much reverb on some songs, and apparently the intro in L.A. Machineguns doesn't quite play quite in sync with the intro (but I haven't tested that game yet). Here's my current modified code in the attached zip (haven't really done much with the DSP file yet):

Re: Audio Timing

PostPosted: Wed Dec 04, 2019 5:33 pm
by Jiterdomer
Thanks, maybe I should rename this topic Audio Timing. Aside from SCSP board, there are a lot of audio issues within the DSP code like the MP2 music doesn't fade out and stop when transitioning to a different scene.

Re: Audio Timing

PostPosted: Thu Dec 05, 2019 11:43 pm
by sonic32
Well thank you ConversusVans :shock:

The music in Scud Race sounds beautiful.
It's a big change in the sound emulation and I think the code can be added to the official lineup, it's a big improvement.

Re: Audio Timing

PostPosted: Fri Dec 06, 2019 9:09 am
by Conversus W. Vans
sonic32 wrote:Well thank you ConversusVans :shock:

The music in Scud Race sounds beautiful.
It's a big change in the sound emulation and I think the code can be added to the official lineup, it's a big improvement.


You're welcome! :D Fixing the timers wasn't horribly difficult, but I had to comment out certain commands in SCSPUpdateReg, AND modify many functions to use "SCSPs->" instead of "SCSPs[0]".The audio code was written by ElSemi and I believe was used for his Nebula Jukebox sound emulator that can play sound from Model 2 and 3. It played Model 2 music at the correct speed, but Model 3 SCSP games played way too slow, and I'm sure it's because the Model 3 timers weren't being emulated properly.

You have no idea how grateful I am that this emulator is open-source, especially since I used to get so overly-excited back in the day (2011) about playing Harley-Davidson, looking back at my ancient GambitRogue777 account. :P I have Bart to thank for that. Ian and Harry Tuttle for the amazing graphical improvements too. ;)

Re: Audio Timing

PostPosted: Fri Dec 06, 2019 1:18 pm
by Jiterdomer
In other note if you have some time, will you take a look at Shekel's DSB code to implement custom music onto my build?

Re: Audio Timing

PostPosted: Fri Dec 06, 2019 5:08 pm
by Conversus W. Vans
Jiterdomer wrote:In other note if you have some time, will you take a look at Shekel's DSB code to implement custom music onto my build?


I might could do that in the future, but I've been working and I really want to square away that VF3 DSP bug first. On real hardware/official OST, there actually is that "echo" effect, but currently there's too much of it in Supermodel. I was somehow able to get rid of the echo completely in SCSP_DoMasterSamples, but then there weren't anymore guitar solos in the fish fight music on Sega Bass Fishing (which also appears to rely on DSP).

Re: Audio Timing

PostPosted: Fri Dec 06, 2019 11:52 pm
by Jiterdomer
Nice progress you're having there!

Re: Audio Timing

PostPosted: Tue May 12, 2020 2:55 pm
by njz3
Hi,
I was comparing a real Le mans 24 cab with supermodel r793 freshly compiled and noticed a difference in the tempo of the music.
Since supermodel runs at 60fps (Hz), and real hardware is a little bit slower (something like 57.6Hz I believe ?), I tried to change the number of cycles of the SCSP emulation and I saw that there was a SysFPS variable set to 60.0fps.
I changed it to 57.6Hz and the music tempo now play very close to the real hardware. So, I added a configurable variable to tune it, just in case, but it seems ok.
Do you know if changing this value will break something else in the sound emulation?
Best,
Benjamin