OPL2 / VRC7 / FM synth questions

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
User avatar
Disch
Posts: 1848
Joined: Wed Nov 10, 2004 6:47 pm

OPL2 / VRC7 / FM synth questions

Post by Disch »

Being dissatisfied with the VRC7 emu I'm currently using, I've been looking into writing my own. FM Synth is a new territory for me... and the docs aren't quite as straight-forward as NESSOUND.txt was... so I'm still having a few problems understanding the whole picture.

The big references I've been using have been:
http://www.shipbrook.com/jeff/sb.html - OPL2 programming document. (to my understanding... VRC7's sound is a dumbed down OPL2). This doc is more for musicians looking to use the chip rather than for people looking to emulate it... so the descriptions are poor/non-existant... so I've also been using:

http://www.smspower.org/maxim/forumstuff/ym2413am/ - This OPLL document. It provides much greater detail but is clearly for a different (but similar) chip. I'm wondering if the info and constants in this doc can be applied to the OPL2.

These are really the best docs I could find. After several searches, I was unable to find a more descriptive doc relating strictly to the OPL2. If anyone knows of some other docs, I'd love to get my hands on anything I can.

Anyway, after much reading, I've got a general understanding of how everything works. A few of the specifics are still missing, but nothing that can't be ironed out later. There's still some questions relating to the fundamentals which are still nagging at me:

1) KSL / KSR affects both modulator and carrier output I'd assume... correct? Or is it just the carrier?

2) Does the modulator have any effect at all when feedback is on? The way I understand it... the carrier sends its output back on itself (basically taking the modulator's place in the normal formula). Is that right? Or is the modulator still involved somehow? The docs didn't cover feedback that much.

3) I'm confused about purcussive tones. (Bytes 20-35 in the OPL2 doc linked above... when bit 5 is cleared). When this is in effect, do you simply skip the sustain phase and go straight to release? This is the impression I'm under... but a graphic image in the OPLL doc (direct link) clearly shows the release phase being different from the sustain phase (like they both fade out, but the release phase does it faster). Can anyone clarify this?


That's about it for now. I'd really appreciate any help anyone can give me.
User avatar
Quietust
Posts: 1920
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Post by Quietust »

The VRC7 is a YM2413, except it has the rhythm channels removed (and a few other bits as well) - all you need to do is compare their I/O register layouts and it's easy to see.
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.
User avatar
Disch
Posts: 1848
Joined: Wed Nov 10, 2004 6:47 pm

Post by Disch »

okay... so the YM2413 is also the OPL2? o_O Too many names.

Anyway it's good to know that the YM2413 doc there is applicable. Thanks =)

Any futher clarifications by anyone still welcome ^^
User avatar
Quietust
Posts: 1920
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Post by Quietust »

OPL2 is YM3812.
OPL3 is YMF-262.
VRC7 is NOT an OPL2, but an OPLL, or YM2413.
All of these are quite different.
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.
User avatar
Disch
Posts: 1848
Joined: Wed Nov 10, 2004 6:47 pm

Post by Disch »

Alright. I recall reading somewhere the VRC7 was similar to an OPL2, hence my confusion. Thanks for clearing it up =)
User avatar
hap
Posts: 355
Joined: Thu Mar 24, 2005 3:17 pm
Contact:

Post by hap »

Huge topickick, but I practice Taekwondo, so it wasn't too hard.. um

I'm using Jarek Burczynski's YM2413 emulator for the Konami VRC7 sound, and it sounds rather different compared to other NES emulators.

Does the VRC7 have a different internal instrument ROM, or does it just sound different because the sound's going through the Famicom DAC before reaching our ears ? If it's using different instruments, which configuration is the most accurate one ?
User avatar
Quietust
Posts: 1920
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Post by Quietust »

hap wrote:Does the VRC7 have a different internal instrument ROM, or does it just sound different because the sound's going through the Famicom DAC before reaching our ears ? If it's using different instruments, which configuration is the most accurate one ?
It would appear that it does use a different instrument set than a standard YM2413 (that, or all of the people who have made YM2413 instrument sets in the past have been tone-deaf) - you can get a 99% accurate instrument set (made by Kevin Horton) from either the Nintendulator mappers or FCE Ultra.

For convenience, the instrument set can be found below - it is up to you to determine how to transplant these instruments into your own code:

Code: Select all

static const unsigned char default_inst[15][8] = {
	{0x03,0x21,0x04,0x06,0x8D,0xF2,0x42,0x17},
	{0x13,0x41,0x05,0x0E,0x99,0x96,0x63,0x12},
	{0x31,0x11,0x10,0x0A,0xF0,0x9C,0x32,0x02},
	{0x21,0x61,0x1D,0x07,0x9F,0x64,0x20,0x27},
	{0x22,0x21,0x1E,0x06,0xF0,0x76,0x08,0x28},
	{0x02,0x01,0x06,0x00,0xF0,0xF2,0x03,0x95},
	{0x21,0x61,0x1C,0x07,0x82,0x81,0x16,0x07},
	{0x23,0x21,0x1A,0x17,0xEF,0x82,0x25,0x15},
	{0x25,0x11,0x1F,0x00,0x86,0x41,0x20,0x11},
	{0x85,0x01,0x1F,0x0F,0xE4,0xA2,0x11,0x12},
	{0x07,0xC1,0x2B,0x45,0xB4,0xF1,0x24,0xF4},
	{0x61,0x23,0x11,0x06,0x96,0x96,0x13,0x16},
	{0x01,0x02,0xD3,0x05,0x82,0xA2,0x31,0x51},
	{0x61,0x22,0x0D,0x02,0xC3,0x7F,0x24,0x05},
	{0x21,0x62,0x0E,0x00,0xA1,0xA0,0x44,0x17}
};
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.
Post Reply