Skip to content

VGM OPM 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 OPM clock converter+note rescaler

Post by MaliceX »

No, you're not seeing double. This is for YM2151 (OPM).

This one was a bit more tricky since the chip arranged its notes in linear space, which made some initial confusion on rescaling the keys (when in actual fact it is simply a shift/mathematical 'translation' of the note range in one direction or another). This probably also means translating between clocks may not be as precise, although it is still a lossy conversion anyway.

last updated 23 May 2015
changes:
  • (23-May)Added some cases for some other chip commands for skipping commands
  • (23-May)Fixed Data block skipping
  • (22-May)Rewrote command writer component to use a channel note history approach. (still not perfect for optimized VGM's when using odd clock ratios, but otherwise works for the most part)
Win32 Binary:
https://www.dropbox.com/s/xhp52uxrb44ni ... k.exe?dl=0

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

Known bugs:
  • Had to add in a rather hacky processed command history, since OPM doesn't discriminate on whether KeyCode or KeyFraction commands come first. It's not perfect but it'll do for unoptimized VGM's straight from an emulator...I hope (since most are optimized! Unoptimized VGMs may have better luck) - reimplemented using note history technique
  • Some re-pitching elements still somehow get missed or are translated wrong for optimized VGM's, especially when using clock speeds that do not divide nicely by the original clock speed.
  • As with the OPN clock converter, does not work well with mixed chip VGMs but should work fine with everything but YM2151 stripped out. - mostly fixed
  • No command line usage prompt.
  • DAC control commands get in the way (similar to multi-chip problem) - fixed
Examples:
https://www.dropbox.com/s/we1kl9btb7ayi ... z.vgm?dl=0 - Soldam Title (3.5MHz -> 900kHz) - upper ceiling ftw!
https://www.dropbox.com/s/vpuyfraltqav2 ... e.vgm?dl=0 - Soldam Title (3.5MHz -> 4MHz)
https://www.dropbox.com/s/j8remuhrfb8dv ... d.vgm?dl=0 - Asuka 120% Kumi Stage (4MHz -> 3.579545MHz, post-optimized)
https://www.dropbox.com/s/0l4wiubvqrezy ... d.vgm?dl=0 (4MHz -> 0.5MHz - PRE-optimized)
https://www.dropbox.com/s/w8hpc7goh10dg ... z.vgm?dl=0 - Fantasy Zone II DX - Opa-Marimba (4MHz -> 1.78MHz)
https://www.dropbox.com/s/9lhgg9v4mmalv ... d.vgm?dl=0 - Battle Garegga (no ADPCM) Sound Test 06 - (4MHz -> 3.579545MHz)
https://www.dropbox.com/s/kykq43mwtz53g ... d.vgm?dl=0 - Ys (X68k) Zepik Village (4MHz -> 3.5MHz)

Problem examples:
https://www.dropbox.com/s/scp8oy2swub62 ... f.vgm?dl=0 - Asuka 120% Kumi Stage (4MHz -> 5.432123MHz) - what you get when commands don't get parsed correctly in an optimized vgm. :(
https://www.dropbox.com/s/csryhk4v96e54 ... d.vgm?dl=0 - Ys (X68k) Zepik Village (4MHz -> 3.579545MHz) - rounding cent issues on kfrac.
Last edited by MaliceX on 2019-07-21, 18:00:45, edited 1 time in total.
-dj.tuBIG/MaliceX
  • Pencioner Offline
  • Posts: 2
  • Joined: 2017-10-17, 22:14:27

Post by Pencioner »

Found this great tool but unfortunately files are no longer available on propbox (the same goes for OPN rescaler). Need it badly now because i got real YM2151 cartridge for my MSX and i play vgms on a real hardware now - and some of rips not just being transposed/wrongly pitched (OPN) but they are sounding very ugly sometimes (OPM rips). Would you make me a favor and reupload files, please? :)
Post Reply