Page 1 of 1

YM2612: Streets of Rage 2 character select and punch sounds

Posted: Mon Nov 26, 2012 4:47 pm
by Arbee
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 :)

Posted: Mon Nov 26, 2012 7:45 pm
by neologix
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.

Posted: Mon Nov 26, 2012 7:48 pm
by Eke
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.

Posted: Tue Nov 27, 2012 4:00 am
by Arbee
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 :)

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

Posted: Wed Jul 19, 2017 12:53 pm
by dink
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

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

Posted: Wed Jul 19, 2017 6:37 pm
by Sik
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.

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

Posted: Wed Jul 19, 2017 7:42 pm
by Chilly Willy
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.