Previous Thread
Next Thread
Print Thread
Page 1 of 5 1 2 3 4 5
Joined: Feb 2009
Posts: 3
S
Member
Member
S Offline
Joined: Feb 2009
Posts: 3
Hi,

I am not 100% sure this is the best place in the world to post this - but here it goes. If anyone knows of a better place to ask this question, please tell me what it is. Thanks.

I am just getting into FM synthesis and am particularly interested in the YM2151. This chip provided the music to arcade games like Peter Pack Rat, 720, Marble Madness and more. There is a VERY good vst/plugin for musicians called VOPM that emulates this chip.

I have read on places like OCR that you can follow steps to dump the sound data from a Genesis emulator and have it be read by a program that will give you all the necessary Operator, Carrier, ASDR, LFO, etc ... data so you can pick an instrument you like from a genesis game and then put those settings into VOPM and get the same sound. [Note that the genesis chip is a scaled down OPM/2151 chip - so this works].

So here is my question: How can the same thing be done for arcade games? I have looked EVERYWHERE for ideas how to do this and have come up with nothing. So far the best idea I have come up with is to edit the ym2151.c code for mame to output all the data I need ... I think this may already be done with its "cym logging" in the code but what do I do with the .cym file and is this logging even still supported in MAME?

The reason I post this here is because if m1 uses mame code (like ym2151.c), I think it would be MUCH easier to go to the song in the game I am interested in and THEN kick off the dump/logging. If m1 open source? I do not see the code around here ...

If anyone can help me out I would greatly appreciate it. There are some very non-standard "patches" used in some of these arcade games - I would love to be able to use and/or play around with these instruments in my music.

Thanks

Joined: Mar 2001
Posts: 17,239
Likes: 263
R
Very Senior Member
Very Senior Member
R Offline
Joined: Mar 2001
Posts: 17,239
Likes: 263
One caveat: contrary to what's commonly said on the Internet, the Genesis YM2612 is OPN series and not directly compatible with the YM2151 OPM or the AdLib's OPL. (Early emulators including ancient MAME tried to translate the parameters and shove everything through the AdLib/SoundBlaster's OPL chip and it generally sounded awful).

That out of the way, logging the registers in MAME is probably your best bet for what you want to do. Source is not currently available for M1. If you can point me to the instructions on translating Genesis patches I can get a better idea of exactly how you'd need to go about things.

Joined: Feb 2009
Posts: 3
S
Member
Member
S Offline
Joined: Feb 2009
Posts: 3
Thank you for the quick reply.

Check out this url for instructions on porting Genesis voices/instruments to VOPM:

http://www.ocremix.org/forums/showthread.php?t=4619&page=2

The process is described by "DXFreak".

And yes, OPN and OPM are quite different chips - not many people recognize that but if you listen to Genesis ports of OPM games (Roadblasters comes to mind) it sounds like a crude toy compared to the beautiful music of the arcade game. I could not imagine the music of Peter Pack Rat ported to the Gesnsis in a million years. Just messing around with VOPM has really lead me to appreciate the chip as a musical instrument - it may not be as flexible or as powerful as the DX7 - but it certainly as a clean clarity to the sounds and can produce very interesting sounds. And being able to discover patches from arcade games for me would be a very powerful tool in learning FM synthesis.

Right now I think adjusting the CYM-logging code in ym2151.c in mame is my best bet. Right now that logging is just crude register dumps - I don't quite understand how it is supposed to be read and how all the VOPM settings could be interpreted from it. I'd rather make huge, ugly logs that say things like: C1/TL = 0, M1/TL=23, M1/AR=31 ... etc etc.

I am not looking forward to this process by any means - but the cym logging looks totally undocumented ... hence my attempt to ask for help here.

Thanks again.

Joined: Dec 2004
Posts: 113
Likes: 5
P
Senior Member
Senior Member
P Offline
Joined: Dec 2004
Posts: 113
Likes: 5
Originally Posted by SevenNine
Right now I think adjusting the CYM-logging code in ym2151.c in mame is my best bet. Right now that logging is just crude register dumps - I don't quite understand how it is supposed to be read and how all the VOPM settings could be interpreted from it. I'd rather make huge, ugly logs that say things like: C1/TL = 0, M1/TL=23, M1/AR=31 ... etc etc.

I am not looking forward to this process by any means - but the cym logging looks totally undocumented ... hence my attempt to ask for help here.

There's really not a lot to say about the CYM logging. It logs each register offset/value byte pair or a '0' byte to mark a 110Hz 'tick' to preserve some timing. It's not really meant to be parsed by hand.

You should stick a load of fprintfs throughout the big ym2151_write_reg switch statement to explicitly log the parameters you're interested in. If you need help with this, let me know. I'm quite a fan of the ol' YM-2151 too smile

Joined: Mar 2001
Posts: 17,239
Likes: 263
R
Very Senior Member
Very Senior Member
R Offline
Joined: Mar 2001
Posts: 17,239
Likes: 263
Yeah, I might try and mess with this stuff myself a bit - Atari really did do some fantastic 2151 programming.

Joined: Dec 2004
Posts: 113
Likes: 5
P
Senior Member
Senior Member
P Offline
Joined: Dec 2004
Posts: 113
Likes: 5
Ok, after giving this a little thought I've decided to try hacking the YM-2151 core to spit out VOPM-compatible presets on a key-press (and also allow you to selectively disable FM channels).

Joined: Mar 2001
Posts: 17,239
Likes: 263
R
Very Senior Member
Very Senior Member
R Offline
Joined: Mar 2001
Posts: 17,239
Likes: 263
Cool! smile

Joined: Mar 2006
Posts: 1,080
Likes: 7
L
Very Senior Member
Very Senior Member
L Offline
Joined: Mar 2006
Posts: 1,080
Likes: 7
<infodump>
'OPS' series
ym2128/ym2129:'OPS' and 'EGS': ?16? channels of 6-operator FM synthesis with all the features of the OPM and more. undocumented, needs reverse-engineering for mess.

'OPM' series
ym2151:'OPM' 8 channels of 4 operator FM synthesis with LFO, detune, and other fun features. Uses an external DAC for output.
ym2164:'OPP' same as ym2151 but with multitimbre (channel linking? multiple notes per channel? not sure) stuff; undocumented, needs reverse-engineering for mess. Uses an external DAC for output.
ym2414(B):'OPZ', similar to ym2151 but allows source waveform for each channel to be selected as one of 8 waveforms much like the opl3, instead of being fixed as sine. undocumented, needs reverse-engineering for mess. Uses an external DAC for output.

'OPN' series
ym2203:'OPN' basically an SSG (read: ay-3-8910 clone) with added 4-op fm synthesis; 3 channels of FM; does not have LFO, but supports almost everything else the OPM does. has two (or three?) 8-bit i/o ports. Uses an external DAC for output.
ym2608:'OPNA' an OPN with 6 channels of FM instead of 3, SSG, and an adpcm BUS for encoding/decoding adpcm. has one 8-bit i/o port. Uses an external DAC for output; Stereo; Has internal ?adpcm? samples for Rhythm instruments.
ym2610(B):'OPNB' an OPN with 4 channels (B version has 6 channels) of FM instead of 3, SSG, and a DUAL adpcm bus for encoding/decoding adpcm (simultaneously?). has no i/o ports. Uses an external DAC for output; Stereo; Has internal ?adpcm? samples for Rhythm instruments.
ym2612:'OPN2' an OPN with 6 channels of FM instead of 3, NO SSG channels, and an adpcm channel sharing the time-slot of the last FM channel. Stereo Internal DAC, time-multiplexed output (i.e. the 6 channels are not pre-mixed and then sent to DAC, but 'rendered' in sequence to the DAC rapidly);
ym3438:'OPN2C' same as OPN2, but CMOS instead of NMOS. Uses much less power and hence runs cooler. Cannot usually be used as a replacement for the OPN2 as its inputs are ?not TTL compatible?(ask Charles Macdonald about this). Supposedly fixes two bugs in the OPN2: the sine wave 'downward slope portion' is no longer 1 unit too high; the dac no longer powers down (causing noise/clicks) when it hits exactly 0.000.

'OPL' series
ym3526:'OPL' 2-op FM synthesizer with 9 channels of FM; sine wave as source waveform only. Has 3 rhythm channels which can double as FM. Relatively limited compared to OPM/OPN (no detune, no SSG-EG, etc) but has many channels. SUPPOSEDLY has the same 'downward slope portion' bug as OPN2 does. Uses an external DAC.
ym3812:'OPL2' 2-op FM synthesizer with 9 channels of FM; pin-compatible and register compatible with ym3526, only addition is now has 4 different source waveforms (sine, rectified/absolute sine, half-period sine, and rising-portion-of-absolute-sine-wave-only sine. Still has the 'downward slope portion' bug. Uses an external DAC.
ym2413:'OPLL' 2-op FM synthesizer with 9 channels of FM; more or less an OPL2 with only 2 source waveforms and most (but not all) of the extra features stripped out; has 15 fixed instruments from internal rom (needs decapping) usable, and one user-controllable instrument. No CSM mode. Internal DAC, time-multiplexed output (i.e. 6 of the 9 channels are not pre-mixed and then sent to DAC, but 'rendered' in sequence to the DAC rapidly; the remaining 3 channels come out a separate pin, with their own DAC, or possibly multiplexed from the same main DAC) NOTE: the Konami VRC7 chip is an NES mapper chip with an on-die clone or licensed copy of the ym2413; it has a (mostly) different instrument rom, does not support the rhythm channels, and has only 6 fm channels instead of 9.
ymf262L:'OPL3' 2-op/4-op FM synthesizer with 18 channels of FM; pretty much an enhanced OPL2 with twice as many channels. No CSM mode. Uses an external DAC. Requires a clock running at 4 times the speed that the other Yamaha chips run at. Has a 4-op mode which yields 6 channels of 4 op, 6 channels of 2 op. Stereo. Has internal DAC, unknown if it is multiplexed or not but it wouldn't surprise me.

Some later chips exist which are single chip implementations of OPS/EGS, a chip called OPN3 which I have no info on, and another chip which is a combination of an OPL3 and an OPN3 on one chip. I have very little information about any of these. They all have YMFxxx numbers.
</infodump>

In short:
Most OPM instruments EXCEPT THOSE THAT USE LFO can be losslessly converted to OPN instruments. Some can be converted to the 4-op OPL3 format but this is lossy as OPL3 doesn't support detune and some other features like SSG-EG.
Pretty much everything can be converted to OPZ instruments, but those chips are very rare.

LN

Last edited by Lord Nightmare; 02/18/09 01:01 AM. Reason: update stuff from knurek

"When life gives you zombies... *CHA-CHIK!* ...you make zombie-ade!"
Joined: Nov 2003
Posts: 459
K
Senior Member
Senior Member
K Offline
Joined: Nov 2003
Posts: 459
OPNA also has rhythm channels, not sure how MAME/MESS handle those, but Hoot and other japanese players need wave files sampled from the original chip (2608_bd.wav, 2608_hh.wav, 2608_rim.wav, 2608_sd.wav, 2608_tom.wav, 2608_top.wav).

Also, IIRC OPN is mono, while OPNA adds panning control.

Joined: Mar 2001
Posts: 17,239
Likes: 263
R
Very Senior Member
Very Senior Member
R Offline
Joined: Mar 2001
Posts: 17,239
Likes: 263
The 2608 waveforms are in the source in MAME - Jarek extracted them through the test port or something.

Page 1 of 5 1 2 3 4 5

Moderated by  R. Belmont 

Link Copied to Clipboard
Who's Online Now
3 members (Dorando, 2 invisible), 221 guests, and 2 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,331
Posts122,192
Members5,077
Most Online1,283
Dec 21st, 2022
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Powered by UBB.threads™ PHP Forum Software 8.0.0