Skip to content

VGMPlay / in_vgm

Last update: 2023-12-31 (v0.51.1)

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

Moderator: Staff

  • User avatar
  • ValleyBell Offline
  • Posts: 4745
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

Just to be sure ... the correct chip volume levels for Namco System 2 are YM2151 220% and C140 100%, right?
  • User avatar
  • 2ch-H Offline
  • Posts: 280
  • Joined: 2012-01-03, 2:10:28

Post by 2ch-H »

Researching the all Namco System 2, the volume balance there was a YM2151 170%, C140 100% and YM2151 220%, C140 100%. (Volume balance of M1)
VGMPlay / in_vgm set in the YM2151 170% and C140 100%, YM2151 220% and C140 100% to adjust the chip balance individually.
This way think properly.
  • zzo38 Offline
  • Posts: 51
  • Joined: 2013-02-18, 3:17:44
  • Contact:

Post by zzo38 »

Maybe you should do something such as add a command 0x69 to set up the master volume of a chip, to override the default settings (the default settings might be chosen by the configuration file and/or GD3 tags), although the user can further override it, or depending on the player it might send the commands to those actual chips in which case the master volume will be ignored.
Last edited by zzo38 on 2013-05-05, 8:28:42, edited 1 time in total.
  • User avatar
  • ValleyBell Offline
  • Posts: 4745
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

I already added an "extra header" section that allows to adjust the chip volume on a per-vgm basis in v1.70.
I just haven't written tools that write these values yet. (Currently I resize the header with vgm_ptch and overwrite a few bytes using a mini-tool.)

Anyway, I found:
- MAME Namco System 2 "default": YM2151 0.80, C140 0.75 (100%/94%)
- MAME Namco System 2 "default3": YM2151 1.00, C140 0.45 (100%/45%)
- MAME Namco System 2 "metlhawk": YM2151 0.80, C140 1.00 (100%/125%)
- MAME Namco System 21: YM2151 0.30, C140 0.50 (100%/166%)
- M1 Namco System 2: YM2151 0.80, C140 0.40 (100%/50%)
- M1 Namco System 21: YM2151 0.80, C140 0.45 (100%/56%)
This is really a mess, but I think I'll go with default values of YM2151 100% and C140 50% for the next release of VGMPlay.
  • User avatar
  • 2ch-H Offline
  • Posts: 280
  • Joined: 2012-01-03, 2:10:28

Post by 2ch-H »

ValleyBell wrote:This is really a mess, but I think I'll go with default values of YM2151 100% and C140 50% for the next release of VGMPlay.
I think it is good.
  • zzo38 Offline
  • Posts: 51
  • Joined: 2013-02-18, 3:17:44
  • Contact:

Post by zzo38 »

When is the VGMPlay release that support these "extra header", and the document to describe its format?
  • User avatar
  • ValleyBell Offline
  • Posts: 4745
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

  • User avatar
  • RichterEX2 Offline
  • Posts: 191
  • Joined: 2012-03-30, 9:28:37
  • Location: Georgia, USA

Post by RichterEX2 »

Would it be possible to add interpolation for sample-based chips? I know you can set the Chip sample rate to make the FM in quite a few games sound better. But it doesn't help much with stuff like QSound and a few others.
  • User avatar
  • ValleyBell Offline
  • Posts: 4745
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

For FM chips, "interpolation" is quite easy in general. Most of them are written in a way that supports any sample rate while keeping the frequencies correct and the tables with sine-values are quite large (YM2612 has 2^10 values for the 0..1..0 part). So they effectively skip some samples at almost any sample rate and frequency. (i.e. they don't need any interpolation)

For PCM chips it's a bit more difficult. Most of them are written with their native sample rate in mind (32 KHz for the RF5C chips, for example), although it seems that the M1 developers modified them to run at the final output sample rate. (M1 seems to lack a resampler.) If I try to port a few lines from there I should be able to get them running at any sample rate.
The second problem is the actual interpolation. While the interpolation itself shouldn't be too difficult, I need to study how the chips work regarding loop points and other oddities (like banks and address wrap).

tl;dr It'll need lots of time and I have other priorities right now. (like adding MultiPCM support to my tools)
I'm always open for contributions though.
  • User avatar
  • dissident93 Offline
  • Posts: 204
  • Joined: 2012-02-17, 5:54:01
  • Location: USA

Post by dissident93 »

RichterEX2 wrote:Would it be possible to add interpolation for sample-based chips? I know you can set the Chip sample rate to make the FM in quite a few games sound better. But it doesn't help much with stuff like QSound and a few others.
what chips sound better with a different sample rate? sorry if I missed a list of this somewhere.
  • User avatar
  • RichterEX2 Offline
  • Posts: 191
  • Joined: 2012-03-30, 9:28:37
  • Location: Georgia, USA

Post by RichterEX2 »

Robocop is one. Sounds horribly aliased before turning up the chip rate.
  • User avatar
  • ValleyBell Offline
  • Posts: 4745
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

Right ... Robocup usually runs the YM2203 at a 20833 Hz sample rate (the chip itself runs at only 1.5 MHz) and the YM3812 outputs with 41666 Hz.
Another good example for chips that sound better at higher sampling rates is the C140 chip. It has a sample rate of 21390 Hz in all Namco System games, which seems to be a lot lower than the native sample rate of most samples it plays.
  • User avatar
  • dissident93 Offline
  • Posts: 204
  • Joined: 2012-02-17, 5:54:01
  • Location: USA

Post by dissident93 »

The sample rate settings in in_vgm kind of confuse me. I currently have mine set at 44100 playback rate, HQ resampler, and native. So I have to physically change the sample rate for different games?

Or what is the best setup? I would think the one I have currently would be that..
  • User avatar
  • ValleyBell Offline
  • Posts: 4745
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Post by ValleyBell »

"Playback Rate" is the sample rate of the final sound stream (or WAV file, if you use the disk writer). Everything gets resampled to this rate. I recommend 44100 or 48000.
"Resampling Mode" is what is says. I usually use "HQ resampling". The LQ setting is for very slow machines, because it is a bit faster.

"Chip Sample Mode" and "Chip Rate" tell you, which at sample rate the sound chips are emulated. FM chips often use at a fairly high sample rate (> 48 KHz), the sample rate of most PCM chips is a bit lower.
However, emulating FM chips at a non-native sample rate can cause the sounds that use feedback and white noise to sound different.
On PCM chips though, the sound usually can only improve.

I usually have "Chip Sample Mode" set to "highest", which chooses between the native chip sample rate and the one set in the "Chip Rate" field, depending on whether is higher. This usually results in a high sample rate for some PCM chips, but the YM2612 is still emulated with its native sample rate (~55 KHz) and sounds more accurate this way.
(If you set "Chip Rate" to 0, btw, it's supposed to use the "Playback Rate" instead, but due to a bug this only works in VGMPlay right now.)
  • User avatar
  • dissident93 Offline
  • Posts: 204
  • Joined: 2012-02-17, 5:54:01
  • Location: USA

Post by dissident93 »

ah ok, thanks.
Post Reply