YM2612: Streets of Rage 2 character select and punch sounds

For anything related to sound (YM2612, PSG, Z80, PCM...)

Moderator: BigEvilCorporation

Post Reply
Arbee
Interested
Posts: 16
Joined: Sat Aug 02, 2008 5:35 pm
Location: USA
Contact:

YM2612: Streets of Rage 2 character select and punch sounds

Post by Arbee » Mon Nov 26, 2012 4:47 pm

I got this report recently that the character select and punch in the air sounds are quite different between MAME's 2612 and Kega or a real Megadrive of indeterminate version. (The attached .oggs certainly indicate *something* is awry).

He later said it's also correct in the year-old Windows build of GenPlus-GX so presumably it's something Eke-Eke (and Nemesis and everyone here) found and fixed prior to that point. I've kept MAME's 2612 in pretty close sync with changes to GenPlus-GX as they've happened (most recently a few weeks ago to get the LFO fixes for surfing in California Games) so I'm at a bit of a loss as to what change I missed short of just mass-porting Eke's version.

Any ideas where in the code to look would be appreciated :)

neologix
Very interested
Posts: 122
Joined: Mon May 07, 2007 5:19 pm
Location: New York, NY, USA
Contact:

Post by neologix » Mon Nov 26, 2012 7:45 pm

Streets of Rage 2? I'd look either in the SSG or (more likely) the channel 3 CSM mode code; alternate location is the PSG's noise channel. I know SoR 1 kept pissing me off when I first wrote my JavaScript VGM2MID, as it was the first set of VGMs that I found had CSM registers logged, and the PSG noise channel tripped me up a bit when I was first writing my web-based VGM player.

Eke
Very interested
Posts: 884
Joined: Wed Feb 28, 2007 2:57 pm
Contact:

Post by Eke » Mon Nov 26, 2012 7:48 pm

I think Haze is right and it's something related to how MAME/MESS resample the chip original output to the emulator output samplerate.
Another possibility could be how the chip emulation is synchronized to CPU writes and reads, as this is also done externally (in sound.c).
Those are the 2 things that could cause issue even when copypasting the code in ym2612.c (and it's the reason why most if not all VGM players can produce inaccurate sounds when using this core, as opposed to the Gens one which does the resampling and resyncing internally, it's not the core which is inaccurate but the way it is used).

Otherwise, I don't think there was anything special with the punch sound beside maybe the DAC register shift level (not sure which game in the serie was affected by that) and i'm pretty sure you correctly reported all the changes i made (there wasn't actually much changes since the last batch coming after Nemesis tests, only that LFO waveform fix). Also note that i removed the possibility to run the chip at a specified samplerate because it was adding some bits of precision when it shouldn't but it's not gonna be so much noticeable.

Arbee
Interested
Posts: 16
Joined: Sat Aug 02, 2008 5:35 pm
Location: USA
Contact:

Post by Arbee » Tue Nov 27, 2012 4:00 am

I really doubt that resampling imprecision could cause us to play a pure tone instead of the white noise type sound that Kega produces. I guess I'll keep looking :)

dink
Interested
Posts: 16
Joined: Thu Dec 31, 2015 3:37 am

Re: YM2612: Streets of Rage 2 character select and punch sounds

Post by dink » Wed Jul 19, 2017 12:53 pm

Was anything found that could possibly fix the funny punch sound in SOR2? I'm currently trying to fix this bug in FBAlpha's Megadrive core for a friend.

best regards,
- dink

Sik
Very interested
Posts: 939
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

Re: YM2612: Streets of Rage 2 character select and punch sounds

Post by Sik » Wed Jul 19, 2017 6:37 pm

I was looking at SOR1's sound effects not long ago and I noticed that pretty much all sound effects use the third FM channel in special mode (i.e. every operator with its own frequency) and constantly changing the values. There's a high chance that handling this wrong could lead to completely wrong sounds.

SOR2 uses the same sound effects as SOR1 if I recall correctly, so the same probably applies.
Sik is pronounced as "seek", not as "sick".

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Re: YM2612: Streets of Rage 2 character select and punch sounds

Post by Chilly Willy » Wed Jul 19, 2017 7:42 pm

Sik wrote:
Wed Jul 19, 2017 6:37 pm
I was looking at SOR1's sound effects not long ago and I noticed that pretty much all sound effects use the third FM channel in special mode (i.e. every operator with its own frequency) and constantly changing the values.
Speech synthesis using formants, huh? I guess that's one way to compress your sound. Four formants was also good for synthesis at that time.

Post Reply