Previous Thread
Next Thread
Print Thread
Page 1 of 5 1 2 3 4 5
#48135 - 02/17/09 06:17 AM Discovering FM Instruments with m1  
Joined: Feb 2009
Posts: 3
SevenNine Offline
Member
SevenNine  Offline
Member

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

#48147 - 02/17/09 03:35 PM Re: Discovering FM Instruments with m1 [Re: SevenNine]  
Joined: Mar 2001
Posts: 15,588
R. Belmont Online content
R. Belmont  Online Content

Very Senior Member

Joined: Mar 2001
Posts: 15,588
USA
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.

#48150 - 02/17/09 04:50 PM Re: Discovering FM Instruments with m1 [Re: R. Belmont]  
Joined: Feb 2009
Posts: 3
SevenNine Offline
Member
SevenNine  Offline
Member

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.

#48151 - 02/17/09 05:38 PM Re: Discovering FM Instruments with m1 [Re: SevenNine]  
Joined: Dec 2004
Posts: 108
Phil Bennett Offline
Senior Member
Phil Bennett  Offline
Senior Member

Joined: Dec 2004
Posts: 108
San Jose, CA
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

#48152 - 02/17/09 05:43 PM Re: Discovering FM Instruments with m1 [Re: Phil Bennett]  
Joined: Mar 2001
Posts: 15,588
R. Belmont Online content
R. Belmont  Online Content

Very Senior Member

Joined: Mar 2001
Posts: 15,588
USA
Yeah, I might try and mess with this stuff myself a bit - Atari really did do some fantastic 2151 programming.

#48161 - 02/17/09 08:55 PM Re: Discovering FM Instruments with m1 [Re: R. Belmont]  
Joined: Dec 2004
Posts: 108
Phil Bennett Offline
Senior Member
Phil Bennett  Offline
Senior Member

Joined: Dec 2004
Posts: 108
San Jose, CA
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).

#48162 - 02/17/09 09:08 PM Re: Discovering FM Instruments with m1 [Re: Phil Bennett]  
Joined: Mar 2001
Posts: 15,588
R. Belmont Online content
R. Belmont  Online Content

Very Senior Member

Joined: Mar 2001
Posts: 15,588
USA
Cool! smile

#48174 - 02/17/09 11:45 PM Re: Discovering FM Instruments with m1 [Re: R. Belmont]  
Joined: Mar 2006
Posts: 983
Lord Nightmare Offline
Senior Member
Lord Nightmare  Offline
Senior Member

Joined: Mar 2006
Posts: 983
PA, USA
<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!"
#48175 - 02/18/09 12:18 AM Re: Discovering FM Instruments with m1 [Re: Lord Nightmare]  
Joined: Nov 2003
Posts: 459
Knurek Offline
Senior Member
Knurek  Offline
Senior Member

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.

#48177 - 02/18/09 12:42 AM Re: Discovering FM Instruments with m1 [Re: Knurek]  
Joined: Mar 2001
Posts: 15,588
R. Belmont Online content
R. Belmont  Online Content

Very Senior Member

Joined: Mar 2001
Posts: 15,588
USA
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 

Who's Online Now
1 registered members (anikom15), 13 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Shout Box
Forum Statistics
Forums9
Topics8,341
Posts107,801
Members4,739
Most Online225
May 26th, 2014
Powered by UBB.threads™ PHP Forum Software 7.6.0
Page Time: 0.034s Queries: 15 (0.012s) Memory: 5.0252 MB (Peak: 5.2541 MB) Zlib enabled. Server Time: 2017-05-30 05:23:49 UTC