VERY strange! How to truly reset the YM2413/MSX-MUSIC?

By Bengalack

Champion (480)

Bengalack's picture

12-01-2022, 15:53

"Carry-over of sound" from previous tune occurs Sad It even occurs when manually running Grauw's vgmplay in sequence. It also happens on real hardware - so I believe openmsx 17 emulates this issue correctly.

[Updated: I might have found out why]

I have a vgm-clip (=raw register data) recorded (openmsx vgmrec) from Moon Blaster. The clip is using the drums in the first frame.

Documentation says: "All registers are cleared to 0 by initialization (initial clear IC terminal = 0).", so I do the same before playing a tune (I also do the required waits between writes, 12/84). The problem is: The drum's FIRST sound is OFF/WRONG (a high metallic sound) if another non-drum-tune is played *before* the reset. If I start this clip once again after it was first run (and doing the normal reset), things are audibly correct, no high pitch sound.

How can I possibly reset, if not setting all regs to 0? I know bits and bytes, but I don't really "get" music that well - could it be that some of the registers below is carried over in the first "frame"? Like modulation, vibrato, envelope, attack rate, decay or whatever it is called in the overview below?

(BTW: I am not using FM-BIOS. Have no familiarity with that.)

This is strange :(

Login or register to post comments

By Grauw

Ascended (10306)

Grauw's picture

12-01-2022, 16:01

It sounds like the setting of the initial channel frequency of the drums is omitted?

Before using the drums the frequencies of channels 7-9 must be set to specific values, this should be done by the player but maybe it goes wrong for some reason.

If you record the VGM, you should be able to use the vgm2txt tool to debug which values are set exactly. If the drum is first played (via register 0EH) before its frequency is initialised (via register 16H-18H and 26H-28H), that’ll be the cause.

By Bengalack

Champion (480)

Bengalack's picture

12-01-2022, 16:11

You are fast! Didn't see that you responded already. Thanks. I might have figured out. Isn't it typical, after digging for, like, 6 hours or so, and you finally seek help, you on the right track? I'll get back on this soon.

By Bengalack

Champion (480)

Bengalack's picture

13-01-2022, 22:51

Grauw wrote:

It sounds like the setting of the initial channel frequency of the drums is omitted?

Before using the drums the frequencies of channels 7-9 must be set to specific values, this should be done by the player but maybe it goes wrong for some reason.

Thank! But: There are frequencies set :-(

Grauw wrote:

If you record the VGM, you should be able to use the vgm2txt tool to debug which values are set exactly. If the drum is first played (via register 0EH) before its frequency is initialised (via register 16H-18H and 26H-28H), that’ll be the cause.

Thanks, but it seems to be correct.

I wasn't aware of that tool. Also, I've struggled a lot with tools that require compilation/building, so I seldom use them unless I'm desperate Smile --I've made my own tool, and can easily see the commands/content.

This thread should continue the discussion here: https://www.msx.org/forum/msx-talk/graphics-and-music/ym2413...