Skip to content

vgm_facc

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

Moderator: Staff

  • dgw Offline
  • Posts: 6
  • Joined: 2024-05-18, 12:09:27

vgm_facc

Post by dgw »

I been trying to use vgm_facc to modify some vgm files to use timing rate of 50fps (882 ticks rounding at 44.1khz). Document for vgm_facc refers: 'You can set the Frame Rate with VGMTool ("Playback rate")'. I can not find such a tool, does it still exist? The only way I can achieve it at the moment is by hacking the switch clause in vgm_facc.c file :roll:
  • User avatar
  • ValleyBell Offline
  • Posts: 4826
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Re: vgm_facc

Post by ValleyBell »

vgm_facc looks at the VGM header, "rate" field (offset 0x24) to determine the target frame rate.
You can set that value either using vgm_ptch (command line, "-SetRate" option) or using VGMTool2 r5 (Windows GUI).

I should mention that the rounding algorithm can cause some jitter, because the consoles don't run with exactly 50.00 or 60.00 Hz. The frames happen with something like 59.95, but the tool will take the absolute time of the sound chip events and round that to exact 50/60 Hz. (The only emulator that seems to just do exact 60.00 Hz is Kega Fusion and I'm pretty sure that this is not correct.)
  • dgw Offline
  • Posts: 6
  • Joined: 2024-05-18, 12:09:27

Re: vgm_facc

Post by dgw »

Thank you, that was helpful. (Not using Windows I was unaware of VGMtool application).

So Rate (0x24) has to be set with vgm_ptch to 50 for each file before vgm_facc will quantize the file to 882 timing. There is no way of just forcing vgm_facc to a particular Rate, and if Rate=0 in file then it defaults to 60.

I can run batch conversion using vgm_ptch and vgm_facc on files :)
Last edited by dgw on 2024-05-23, 15:29:02, edited 1 time in total.

Re: vgm_facc

Post by Soundshock »

The way it's supposed to work 0x24 rate doesn't mean anything by itself, it's just a reference point for the original log. If you specify a playback rate in the emulator, it will scale the sample rate of the vgm based on the rate specified in the vgm. For example, running a log with 0x24=60 at playback rate 50 will scale the sample rate like this: 50 / 60 * 44100, directly changing the tempo of the vgm
  • dgw Offline
  • Posts: 6
  • Joined: 2024-05-18, 12:09:27

Re: vgm_facc

Post by dgw »

I was writing my own VGM file player (MC68000 asm), but wanted to use 50Hz frame interrupt for timing (44.1kHz resolution was unfeasible). At the moment it was just a quick way of testing YM2203 chips and hardware were working OK. I can probably do more satisfactory timing later.
Post Reply