VOGONS


First post, by TheMechanist

User metadata
Rank Newbie
Rank
Newbie

Hi,

I'm trying to write a small interrupt driven player for YM3812 VGM-Files for MSDOS.

The format of the VGM File for OPL seems to be quite straight forward:
The VGM Command 0x5A is followed by the OPL register and the value
and VGM Command 0x61 is a delay command followed by a 16Bit-word (specification tells 65535 is a about 1,49 seconds)

So far, so easy and the song "plays" ..
But I don't get the right timings, so when playing the song it's too fast, too slow or jitters ..

What are the correct settings for the PIT? what for the delay? Atm PIT is set to 1000Hz what is obviously not correct, but I have no idea how to set/play it right.
And what does "input clock rate" (offset 0x50), which is "3579545", mean?

That sound stuff is driving me nuts 😀

Thx

Unchained demo group
swap42

Reply 1 of 2, by TheMechanist

User metadata
Rank Newbie
Rank
Newbie

... found the error, setting the PIT to 1000Hz (or any other value) is no problem, it all depends on the right calculation of the delays 😉

Unchained demo group
swap42

Reply 2 of 2, by Tiido

User metadata
Rank l33t
Rank
l33t

From what I know, all the events are 44100Hz based in the VGM stream. And yeah, all is calculating the delays right to match whatever timebase you have to work with.

The 3579545 is the clock of OPL2, it is only concern for the emulation of the chip to get correct sample rate + pitch etc.

T-04YBSC, a new YMF71x based sound card & Official VOGONS thread about it
Newly made 4MB 60ns 30pin SIMMs ~
mida sa loed ? nagunii aru ei saa 😜