Skip to content

VGM OPN clock converter+note rescaler

Technical discussion about the VGM format, and all the software you need to handle VGM files.

Moderator: Staff

  • User avatar
  • MaliceX Offline
  • Posts: 226
  • Joined: 2012-09-29, 11:45:48
  • Location: Australia
  • Contact:

VGM OPN clock converter+note rescaler

Post by MaliceX »

I got bored last night and attempted to write a simple program that converts F-Num commands for the FM channels on OPN chips, as I wanted to see if I could listen to ~8MHz VGMs on the Sega Megadrive, which runs on 7.67MHz therefore will sound flat when imported verbatim.

Source:
https://www.dropbox.com/s/nii8u5y1i6xj7 ... ate.c?dl=0

win32 binary:
https://www.dropbox.com/s/0s7fdiune8uju ... k.exe?dl=0

Working notes written at 2am-5am:
https://www.dropbox.com/s/8vb2tsdgusl48 ... y.txt?dl=0

Last updated 23 May 2015:
Changes:
  • DAC/Data block skipping fixed
  • Added cases of other VGM chip commands to skip.
Known bugs:
  • Still some issues with rounding issues on the extracted fnote. This has an effect for edge cases where the F-Num is very close to the 11-bit limits.
  • SSG frequency update not supported (yet. this is for YM2203/YM2608 integrated YM2149)
  • Low notes don't work correctly fixed!
  • Command-line argument validation not implemented.
  • Command-line usage not present (yet)
  • Seems to misbehave when other chips such as SN76489 are attached to the vgm. This otherwise works flawlessly on vgm's with just YM2612 - mostly fixed
Examples:
https://www.dropbox.com/s/x9krlwsgeus3b ... k.vgm?dl=0 (~8MHz -> 7.67MHz)
https://www.dropbox.com/s/94n4wsmdf07iy ... 0.vgm?dl=0 (~8MHz -> 3.58MHz)
EDIT- fixed? https://www.dropbox.com/s/7aumuciqoqsk7 ... d.vgm?dl=0
https://www.dropbox.com/s/rpbajx7gfijs4 ... x.vgm?dl=0

Problem examples:
https://www.dropbox.com/s/filmer206b16n ... l.vgm?dl=0 (when running vgm_opnclk with SN commands attached)
https://www.dropbox.com/s/hyrfk1phhzmll ... x.vgm?dl=0 (what happens when you don't update F-num for playback on Megadrive. Except PSG was a manual fix via vgm_ayconv (source was ym2608 SSG) -> vgm2mid -> mid2vgm_PSG)
-dj.tuBIG/MaliceX