Skip to content

The exactly sample rate of segapcm VGM files

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

Moderator: Staff

  • Mike77154 Offline
  • Posts: 8
  • Joined: 2019-05-03, 5:49:33

The exactly sample rate of segapcm VGM files

Post by Mike77154 »

hello there

Im trying to open the VGMs in audacity for chopping the Slap Bass and the Distorted guitars from sega model x/y SegaPCM, the idea is use the raw data for making a soundfont the most accurate to the game ost, and in the smaller disk space possible


im trying with unsigned 8-bit, no endianess, in 16000hz sample rate, but seems incorrect, so here is the question


Can you tell me please, which is exactly sample rate per game VGM for load it in audacity?

there is the games list that i am working on
-After Buner (sega model x)
-After Burner II (sega model x)
-Galaxy Force (sega model x)
-Galaxy Force II (sega model y)
-Thunder Blade (sega model x)

thanks in advance
  • User avatar
  • ValleyBell Offline
  • Posts: 4768
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

The sample rate is hardcoded into the sequence data for the sound driver, so there is no general value.

The SegaPCM chip outputs a sample rate of 31250 Hz.
It has an 8-bit "sample delta" register (256 steps, values from 0 to 255) for controlling the pitch of the sample playing on a channel. Its value specifies the fraction of the chip's sample rate the sample plays with.
Thus, you can calculate the rate the samples plays at with this formula: 31250 Hz * ([value of sample delta register] / 256)
i.e. if the register is set to 0x80 (hexadecimal for 128), then you get: 31250 Hz * (128 / 256) = 15625 Hz

In order to figure out what values the games use for the register, you could use vgm2txt on a some VGMs that use the SegaPCM chip.
Searching for "Sample Delta Time" in the text file should make you able to find the respective values.
  • cisawohi Offline
  • Posts: 2
  • Joined: 2019-09-29, 17:50:07

Post by cisawohi »

ValleyBell wrote:The sample rate is hardcoded into the sequence data for the sound driver, so there is no general value.

The SegaPCM chip outputs a sample rate of 31250 Hz.
It has an 8-bit "sample delta" register (256 steps, values from 0 to 255) for controlling the pitch of the sample playing on a channel. Its value specifies the fraction of the chip's sample rate the sample plays with.
Thus, you can calculate the rate the samples plays at with this formula: 31250 Hz * ([value of sample delta register] / 256)
i.e. if the register is set to 0x80 (hexadecimal for 128), then you get: 31250 Hz * (128 / 256) = 15625 Hz

In order to figure out what values the games use for the register, you could use vgm2txt on a some VGMs that use the SegaPCM chip.
Searching for "Sample Delta Time" in the text file should make you able to find the respective values.
While testing which point can be the sweet spot as of now?
Regards,
Cisa Smith
Post Reply