VGM input plugin 0.35

Table of Contents

Problems

Here are the things that can go wrong, right at the start so you can find them easily.
  1. VGM files play too fast

    If you have in_gym then disable its VGM handling. It is weird.

    Look at the 50/60Hz options in the config screen - maybe you're used to 50Hz music?

  2. Anything else

    Please contact me!

Introduction

This is a Winamp (2.xx and 5.xx) plugin for playing VGM files. VGM is a standard for logging of SN76489/SN76496, YM2413, YM2612 and YM2151 music chip data, originated by Dave, allowing various systems' games' music to be stored. See http://www.smspower.org/music for more information, and to download VGM music files.

Open this URL in Winamp to hear a demo:

http://www.smspower.org/music/vgm/demo/Golvellius.m3u

To use: put in_vgm.dll in Winamp's plugins\ folder (usually C:\Program Files\Winamp\plugins\), and restart Winamp. If you got the self-installing version then it should already be working.

Load .vgm or .vgz files in Winamp; go to the "File types" preferences page to associate these extensions:

  1. Open the Preferences dialogue box (press Ctrl+P, or right-click and choose Options -> Preferences...)
  2. Choose "File types" from the tree on the left (it's the second item unless Winamp has changed since I wrote this)
  3. Make sure "vgm" and "vgz" are selected in the "Associated extensions" list (if they aren't in the list it's because you have another buggy plugin installed)
Be sure to check out the file info and plugin configuration dialogues.

Credits

Dialogue boxes

VGM file & GD3 tag information

To open: This shows you information about the file and, if it has a GD3 information tag, it shows you information from there too. It's similar to the ID3 information box for MP3s, except that you can't edit the GD3 tag from within Winamp.

Choose English or Japanese to display the GD3 information for that language, if available.

If you see something like "????" for a GD3 entry then your version of Windows doesn't support Unicode, or translation from Unicode to a valid MBCS. If that makes no sense to you, you probably don't care about it. Windows XP is generally OK so long as you have east asian fonts installed.

Click on View GD3 in browser to open either "Now Playing" (the MiniBrowser in older versions of Winamp) or your regular web browser (depending on the setting, see below), with a page showing the GD3 tag. Chances are, if you have the necessary fonts installed, this will be able to display the Unicode text properly on older versions of Windows.

Click on Configure plugin... to open the plugin configuration dialogue box.

If you open this dialogue box for several files in the playlist editor, it will appear once for each file. Press Esc or close the window using the frame controls to abort showing it once per file.

VGM plugin configuration

To open:

Playback tab

Looping
Repeat looped section times
Choose how many times to play the looped section in a VGM file, if it has one. A value of 0 will play through the looped section once.
Then fade out over ms
When repeating looped sections, there is no "end" to the music. Enter a time in ms (1000ms = 1s) over which the music will fade out after looping the desired number of times. A setting of 0 will give no fadeout.
Loop forever
Ignore the looping counter and loop forever. Note that this disables seeking (in Winamp) and thus also the "Immediate update" option.
Pause after non-looped tracks
Pause ms
Even when a track does have an end, it does not sound good if the next track follows on immediately. Enter a time in ms (1000ms = 1s) to pause at the end of each track.
Playback rate
Recorded rate
If this is selected, all VGM v1.01+ files will be played at the rate specified in the file. VGM 1.00 files will be played at 60Hz.
50Hz
60Hz
If 50Hz or 60Hz is selected, all files will be played at that rate - 50Hz corresponds to PAL/SECAM home systems used in Europe and Australia/NZ; 60Hz corresponds to NTSC/PAL-M systems used in Asia and the Americas.
Other: Hz
If you choose this you can enter any rate, to play files extra slowly or quickly. Extreme values and fractional values are not allowed. Note that seeking is buggy with unusual rates.

The effect will only be heard when you restart the track, or when the next track starts.

Volume, muting and panning
Overdrive
Amplifies all sound to levels that are in danger of being clipped, but are similar to regular MP3s so visualisations work better.
Keep muting when track changes
If checked, per-muting will remain when the track changes; otherwise all channels are unmuted.
Randomise panning on track start
For channels with configurable fake stereo, this will apply a Gaussian randomisation to the stereo panning for every channel.
Apply Replay Gain transcoding hack
In the current version of Winamp (5.35) there is no "proper" way for a plugin to apply Replay Gain volume adjustment while transcoding to another format (like MP3). If you check this box, a specific hack is used to turn Replay Gain on while transcoding - it will apply Replay Gain if it can't find the "Calculating Replay Gain" window. Otherwise, transcoded files will not have Replay Gain applied.

GD3 tags tab

Data formatting
Prefer Japanese text
If checked, the media library and advanced title formatting will use Japanese text if available, otherwise English. If unchecked, English text is used in preference to Japanese.
Append (FM) to game name for YM2413
To make it easier to tell FM and PSG soundtracks apart, this will make the returned game name (given as the album name) end with "(FM)". Note that some emulators incorrectly specify an FM clock in the VGM file, causing this to be displayed wrongly.
File Type
Return file type ID
Winamp's Media Library comes by default with filtered views for "Audio" and "Video", as well as other views for things like recently played files. If you right-click on the tree you can edit them and add new views for more advanced filters.

If, like me, you don't want VGMs to play mixed in with your regular MP3s, you can use this to make it very easy to filter VGMs out of the "Audio" view and into another. Here's the procedure:

  1. Change the number to another value (I use 262144)
  2. Add a new view to the Media Library
  3. On the advanced tab, change the query to TYPE=262144 (or whatever number you chose)
  4. Refresh your Media Library from the Library button.
Note that Winamp does not define meanings for values other than 0 (audio) and 1 (video). It might in later versions, so try to use a value that is unlikely to be used in the future (2 is more likely to be used than 262144).
Now Playing
Display GD3 tags as HTML in "Now Playing"
If checked, displaying a GD3 tag as HTML (using the View in browser button described above) will use Now Playing. If unchecked, it will use your regular web browser.
Display them automatically
If checked, GD3 tags will automatically be displayed in Now Playing when tracks start. This will also block most other parts of Winamp from changing the Now Playing page while a VGM file is playing.
Open "Now Playing" if it is closed
If checked, when auto-displaying GD3 tags, Now Playing will be opened if it is closed.

Note that in older versions of Winamp, the MiniBrowser is the equivalent of Now Playing. Also, in versions of Winamp since 5.22, Now Playing does not support this feature; it may return in later versions.

Legacy title formatting Enter text to control what title Winamp shows for the file. Enter special codes like %t to insert various GD3 entries. If the file has no GD3 tag then the filename will be used as the title.

Winamp 5's Advanced Title Formatting bypasses this, instead using data from the Media Library. Look for the Title section in the Winamp preferences, and try [%album% ['['$num(%tracknumber%,2)'] ']- ]%title%[ - %artist%]

SN76489 tab

Chip control You can choose the relative volume of the chip (default: 100) and globally enable/disable it.
Channel control If the current track includes PSG data, the checkboxes will allow you to enable and disable individual sound channels.

The trackbars allow you to apply "fake" stereo to the channels. This can result in a more pleasing sound but is totally inaccurate :) The original chip was strictly mono.

That is, apart from the Game Gear's extended version which allows "digital" stereo (where the sound is either 100% left, centre or 100% right). If the track includes such data then the "fake" stereo for the affected channel is overridden.

Press the Centre all button to reset all channels to a centre position, or press the Randomise button to position them according to a random Gaussian distribution.

Emulation
Smooth PSG vol curve
Applies a smooth logarithmic volume curve to the PSG volume levels; if unchecked, values taken from a real SMS's output are used instead. These values have reduced definition at high volume levels.

YM2413 tab

Chip control You can choose the relative volume of the chip (default: 100) and globally enable/disable it.
Channel control If the current track includes YM2413 data, the checkboxes will allow you to enable and disable individual sound channels. You can also apply "fake" stereo as above.
Emulation
High quality YM2413
This runs the YM2413 engine at the true clock rate and resamples to 44100Hz. The effect is marginal.

YM2612 tab

Chip control You can choose the relative volume of the chip (default: 25) and globally enable/disable it.
Channel control If the current track includes YM2612 data, the checkboxes will allow you to enable and disable individual sound channels. "Fake" stereo is unavailable because the YM2612 supports, and often uses, real stereo.
Emulation
SSG-type envelope generator
This enables a specific emulation feature of the Gens YM2612 engine. Some tracks sound better with it on, but many also sound worse.

YM2151 tab

Chip control You can choose the relative volume of the chip (default: 25) and globally enable/disable it.

VGM7z tab

VGM7z support
Enable
If not enabled, no VGM7z handling is done.

VGM7z is a compact format for distribution of sets of VGM files. in_vgm supports these files by extracting the VGM files from inside the archive and then copmpressing them using normal per-file compression. The result is slightly larger but it gives one file per track, and the files play back quickly and easily without pauses for decompression.

Prompt before extracting
If checked, a prompt will appear before decompression is done. This is handy if you want a warning before starting the extraction process.
Extract to
Same folder as 7z file
Fixed directory:
The first option assumes you will always be opening VGM7z files from the directory you want them to extract into. The second is for the case where you always want your VGM files stored in one directory, so you can open them directly from internet downloads or other directories.
Extract to subfolder named after VGM7z file
This option allows you to enforce that the resulting VGM files are placed into a directory named after the files they came from, to give one directory per VGM pack.
VGM compression
After extracting, the individual VGM files are compressed individually. This slider lets you choose what level of compression to use - higher numbers give smaller files but slower compression.
Delete VGM7z file after extraction
After extraction, you probably have no need for the original VGM7z file. Check this box to automatically delete it after successful extraction.

Bottom part of window

Immediate update
If this is selected, the effect of changing some of the settings will be instant, but it may introduce jumps or pauses to the sound, depending on the output plugin and the type of VGM file playing. If it is not selected then the effect will take the length of the output buffer (usually two seconds) to be heard. Note that cancelling this dialogue box does *not* restore the previous settings for many options.

Actually asked questions

y doesnt the winamp show vgms as associted files? i always have to select .vgm .vgz from the drop down menu.
This is a bug in Windows, at least up to XP (SP2). Try using other methods to load your files. The Media Library is really good, try it!
FM music is not based on SINE waves, is it?!
Yes, it is. "Frequency modulation" means using one sine wave to change the frequency of another, thereby producing quite complex waveforms from two simple sine waves, a Good Thing when it comes to making cheap sound chips. Although one source says "Note that the name 'FM' is a misnomer; in actual fact the Yamaha chips all use phase modulation (PM) to create their sounds." So now you know.
The latest VGM plugin is much slower on my p133. The last one works fine, but with the new one the songs stops and then continues after a second all the time. Why?
Because FM emulation is a lot more complicated than PSG emulation, so it takes more time. You might like to get VGMTool to optimise any VGMs with unnecessary chip data in them, or possibly re-download the files if they've been updated with optimised versions.

How to play VGM files direct from your webpage

You can make it so people can click on a link and have a VGM played in Winamp the same way as you can do it for MP3s...
  1. Make a playlist file for the file(s) you want, listed as full URLs
  2. Link to that
Winamp will try to make it so the playlist file is downloaded and opened by the browser with as little prompting as possible, and in_vgm hooks up with Winamp's downloading routines to play the files themselves. Try this link for an example.

Known issues

History

0.36 beta

Links


Documentation by Maxim

http://www.smspower.org