VGMPlay for MSX

Page 24/28
17 | 18 | 19 | 20 | 21 | 22 | 23 | | 25 | 26 | 27 | 28

By Grauw

Enlighted (6369)

Grauw's picture

12-11-2017, 00:01

Yeah, the ch3-slot-mode is not supported (neither is SSG-type EG), and will probably stay that way since it is rarely used... More trouble than it's worth. For perfect playback of those cases (I haven't found any yet) I think using an actual OPN series chip would be better. But if you have any examples of songs that don't play correctly let me know!

By ImATrackMan

Resident (59)

ImATrackMan's picture

14-10-2017, 10:37

As an experiment I wanted to see if merged VGM files would work. They do but with a couple of drawbacks I guess? The file plays and the actual note timing is correct, but I think the chips start playing at different times (SFG comes in a while after the OPL4 but I may be misremembering). I had to record the two chips separately, but as you can hear the sync is perfect and all I had to do was line up the recordings. This is the merged output of a VGM from Deflemask and a conversion from mod2vgm.

The file also doesn't loop properly, but I don't know if that's a fault of the .mod conversion, the merging, or VGMplay itself. If someone with an expander could test this, I'd really appreciate it:
https://soundcloud.com/im_a_track_man/msx-quarth

https://my.mixtape.moe/nwnaqq.vgm

By Pencioner

Master (248)

Pencioner's picture

11-11-2017, 16:43

Grauw - thank you once more Smile I recently compiled the bitbucket last version of the vgmplay and tested it with SFG clone on some of OPN chips Smile Works very well for YM2203 - because the clock speed is not much difference. Thank you - it beinigs a lot of new tunes to listen btw

But for those chips clocked f.e. at around 400KHz - i thought about some vgm files conversion to 'upclock' a tune. I'm going to have a look at the vgm format spec and i suppose i will need also to look to particular chip manuals as well - but i'd like to have input from experts beforehands - at the first sight is it theoretically possible and what would be the possible pitfalls?

By Grauw

Enlighted (6369)

Grauw's picture

12-11-2017, 00:01

Glad to hear!

When you say 400 KHz I assume you mean 4 MHz… Note frequencies could be corrected realtime (as I do with the YM2612), however it requires quite a bit of work and code space to do it for all the supported sound chips. And since a different frequency generally just means that it plays a few semitones higher or lower, for the time being I’m satisfied with the current implementation.

Note that as for the YM2608 OPNA, YM2610 OPNB and YM2610 OPN2, their clock may be listed as 8 MHz, however it is internally divided to 4 MHz so the pitch difference is similar to the OPN, just a few semitones.

But, check these threads for some off-line frequency conversion tools made by MaliceX:

VGM OPN clock converter+note rescaler
VGM OPM clock converter+note rescaler

By Grauw

Enlighted (6369)

Grauw's picture

11-11-2017, 23:58

By the way, OPNA playback on SFG also “kinda” works, some songs from e.g. YU-NO sound pretty nice. But the ROM drums and ADPCM are missing, so how well it sounds depends on the song, if it uses these a lot. E.g. Hometown from Groundseed is unfortunately really missing a lot in the OPNA version played on the SFG. You can also try OPNB but pretty much all music is too reliant on (unsupported) PCM channels to be playable.

By Grauw

Enlighted (6369)

Grauw's picture

12-11-2017, 00:23

ImATrackMan wrote:

As an experiment I wanted to see if merged VGM files would work. They do but with a couple of drawbacks I guess? The file plays and the actual note timing is correct, but I think the chips start playing at different times (SFG comes in a while after the OPL4 but I may be misremembering).

Indeed! Both play, but the OPM part starts 7 seconds late, and the tracks are misaligned. Seems like that should be fixable… It sounds nice otherwise! Smile

By Pencioner

Master (248)

Pencioner's picture

13-11-2017, 00:12

Grauw, sorry for some confusion. I was playing around the SFG and vgmplay to the late night, and finally i tried tunes for some more chips. Everything is fine with OPN tunes having 4MHz since it is not an real issue - i'm ok with that little of modulation because it still sounds fine btw. Those was OPL tunes (played back with moonsound clone) for YM3812 (358KHz) and YM3526 (300KHz) and also YMF262 (1.4MHz, those at least has some sound and i'm not sure how much pitched but it seemed like a lot - at least the Doom II music I think i remember about). So basically this is not a question about OPN emulation, rather about OPL tunes re-clock, sorry. As far as i can understand - some waveform data if present should be kind of resamled, right?

And another questions - were there any OPN{A,B,2} MSX carts around? Could tunes for YM2608, YM2610 and YM2610A be played on YM2612? I ask because there's some Turbo Sound FM cartridge for ZX Spectrum and i wonder how hard could it be to make MSX version btw.

By Grauw

Enlighted (6369)

Grauw's picture

13-11-2017, 12:47

Hey Pencioner,

The clock frequency dividers for the OPL chips are as follows:

F-num divider 72 (x1): YM3526 OPL, YM2413 OPLL, Y8950 MSX-AUDIO, YM3812 OPL2, YM2203 OPN
F-num divider 144 (x2): YM2608 OPNA, YM2610 OPNB, YM2612 OPN2
F-num divider 288 (x4): YMF262 OPL3
F-num divider 684 (x9.5): YMF289 OPL3-L, YMF278B OPL4

By dividing the clock by the f-num divider you can determine the FM sampling frequency, and if the sampling frequency is the same, they play at the same pitch. So these clock frequencies are equivalent: 72: 3.58 MHz, 144: 7.16 MHz, 288: 14.3 MHz, 684: 34 MHz.

In the examples you mentioned above, the YM3812 @ 3.58 MHz and YMF262 @ 14 MHz songs should play near pitch-perfect. That YM3526 @ 3.00 MHz song plays at a higher pitch of log2(3.58 / 3.00) * 12 = +3 semitones, it’s an arcade machine song probably. The clock frequencies used on the PC should all be a relative match to the MSX frequencies and play either pitch-perfect or with a deviation of a mere 7 cents, including Doom II. You can always verify with another player on the PC or the web.

As for your question about OPN cartridges for MSX, no they were never publicly available, but some homebrew OPNA prototypes exist. Amongst others l_oliveira is experimenting with them as you can see from his Youtube videos. I hope someday someone will produce an OPNA cartridge, the I/O ports are already reserved (14H-17H).

Tunes for the YM2612 OPN2 can be played on the YM2608 OPNA, but not the other way around, since the OPN2 lacks SSG channels as well as drums and ADPCM. Similarly YM2608 OPNA tunes can be played on YM2610 OPNB, but not the other way around, since the OPNA’s 2nd ADPCM unit is hardcoded to use 6 ROM drums. But the OPNB lacks a CPU-SampleRAM interface (it is aimed at arcade boards with ROM chips), so the OPNA is more practical to use on MSX.

p.s. The OPM does not expose the f-num, but the note numbers/fractions are converted to an internal f-number which is divided by 64. When playing OPN music on it, VGMPlay scales the frequency to match a divider of 72, so that it stays in tune with the SSG (PSG).

By Pencioner

Master (248)

Pencioner's picture

13-11-2017, 12:48

Thanks Grauw!

Had to look really carefully. Yes, Moonsound is clocked not at 3.3MHz but at 33MHz and that's my mistake. Could you please print the dots in every 10^3 position? Like 33.868.800 Hz instead of 33868800 Hz? Smile (kind of kidding, i think you can put efforts to something more usable instead of dots). By the way - f.e. this one Atomic Runner plays without sound. Files are rather small so i think they don't contain any PCM data - so now i'm just curious what is the issue.

I verified Doom music with PC vgmplay - and it's another confusion because what i remember is the Doom II music and what i downloaded is Doom (first version) music. Yes, it is played almost the same on PC and MSX - and it is really great!

Many thanks for great explanation on OPN* series, now the compatibility/interchangeability is completely revealed for me :hannibal: If anybody will produce OPN card i'm gonna get it anyway.

By Grauw

Enlighted (6369)

Grauw's picture

13-11-2017, 13:20

Pencioner wrote:

Had to look really carefully. Yes, Moonsound is clocked not at 3.3MHz but at 33MHz and that's my mistake. Could you please print the dots in every 10^3 position? Like 33.868.800 Hz instead of 33868800 Hz? Smile.

The thought occurred to me today Smile.

Pencioner wrote:

By the way - f.e. this one Atomic Runner plays without sound. Files are rather small so i think they don't contain any PCM data - so now i'm just curious what is the issue.

Hmm, no clue, I’ll have to do some investigation.

Pencioner wrote:

I verified Doom music with PC vgmplay - and it's another confusion because what i remember is the Doom II music and what i downloaded is Doom (first version) music. Yes, it is played almost the same on PC and MSX - and it is really great

Doom II was recently submitted, not on the site yet but you can find it here.

Page 24/28
17 | 18 | 19 | 20 | 21 | 22 | 23 | | 25 | 26 | 27 | 28
My MSX profile