VGMPlay for MSX

Pagina 8/47
1 | 2 | 3 | 4 | 5 | 6 | 7 | | 9 | 10 | 11 | 12 | 13

Van Grauw

Ascended (8457)

afbeelding van Grauw

23-03-2015, 20:16

For your convenience, I prepared two VGM packs with extracted VGMs from the VGMRips and SMSPower sites:

http://www.grauw.nl/etc/music/vgm/smspower-fm.zip
http://www.grauw.nl/etc/music/vgm/vgmrips-pack-1.zip

Enjoy!

Van anonymous

incognito ergo sum (109)

afbeelding van anonymous

25-03-2015, 17:34

Thank you for sharing. A couple of questions about the VGM format from the point of view of a non coder Tongue , just out of curiosity and for the general knowledge. Checking the wikipedia explanation about VGM format, it's not very clear. As you told in the newspost, this format logs the commands sent to the soundchips. Even the files are very small, I would say similar to the original ones. Which tool is normally used to extract this data?

I understand that a music composed on MSX (Moonblaster, Trilotracker, MuSICA or whatever) stores the musical notes, instruments and more data related. What is the difference between a VGM music file and original one then?.

Van l_oliveira

Hero (529)

afbeelding van l_oliveira

31-03-2015, 17:04

PAC wrote:

Thank you for sharing. A couple of questions about the VGM format from the point of view of a non coder Tongue , just out of curiosity and for the general knowledge. Checking the wikipedia explanation about VGM format, it's not very clear. As you told in the newspost, this format logs the commands sent to the soundchips. Even the files are very small, I would say similar to the original ones. Which tool is normally used to extract this data?

I understand that a music composed on MSX (Moonblaster, Trilotracker, MuSICA or whatever) stores the musical notes, instruments and more data related. What is the difference between a VGM music file and original one then?.

On a MSX game or music player (MuSICA, Performer OPX, MGSEL or even Moonblaster) we have a music driver program which plays the music from a "music data" (music sheet which tell the driver which notes to play and which tempo to use) table. It processes the said music data and along with other tables which might be part of the music data (musician defined instruments)or the driver itself (music player built in instrument patches data, voices and samples) it create a list of register writes which when ultimately written to the sound chip causes it to produce sounds.

VGM works by logging register writes generated by the music driver, saving them to disc as the song is played.

Van anonymous

incognito ergo sum (109)

afbeelding van anonymous

31-03-2015, 17:35

How does this express itself in performance? I can imagine that using this VGM approach in a demo or game frees up quite a bit of CPU time that could be used for something else. Keeping track of music data, calculating which registers to write... it seems like an awful hassle all of a sudden.

Van l_oliveira

Hero (529)

afbeelding van l_oliveira

31-03-2015, 17:37

snout wrote:

How does this express itself in performance? I can imagine that using this VGM approach in a demo frees up quite a bit of CPU time that could be used for something else. Keeping track of music data, calculating which registers to write... it seems like an awful hassle all of a sudden.

But it's horribly memory wasteful. Only direct wave data streaming would be worse than VGM in that aspect.

Of course if you have optical media as storage (how about we start making MSX games using EMMC chips as ROM storage ?) it doesn't matter that much.

EMMC is a kind of SD card in a chip device which would make game cartridge copying almost impossible for causal pirates.

Van Grauw

Ascended (8457)

afbeelding van Grauw

31-03-2015, 18:14

PAC wrote:

I understand that a music composed on MSX (Moonblaster, Trilotracker, MuSICA or whatever) stores the musical notes, instruments and more data related. What is the difference between a VGM music file and original one then?.

Tracker files can perform certain size and performance optimisations by using specific structures and grids for the song data. The VGM format, because it is a very generic format and does not have any knowledge of the song structure or tempo, it needs to be much more flexible, and is thus less performance and space efficient, because there is more repetition of data.

For example if for example a song alternately plays two bars of music, each using two different instruments, repeated 8 times, the tracker only stores 2 bars worth of pattern data and 2 instrument data, whereas the VGM will store 16 bars of pattern data and 16 instrument data. However if a song barely repeats and does not change instruments a lot, the file sizes will be more comparable.

Van Grauw

Ascended (8457)

afbeelding van Grauw

31-03-2015, 18:51

snout wrote:

How does this express itself in performance? I can imagine that using this VGM approach in a demo or game frees up quite a bit of CPU time that could be used for something else. Keeping track of music data, calculating which registers to write... it seems like an awful hassle all of a sudden.

In theory tracker data can be structured in ways which improve processing efficiency, e.g. by interleaving data in a convenient way, or storing data in a structure which can very quickly be processed by the Z80 (essentially, storing music as MML data). Whether trackers and replayers actually do this is a different matter, but I wouldn’t count on VGMs to be faster to play back than tracker files.

Nevertheless, VGM is pretty efficient to process and is definitely suitable as a format for game BGM. There are definitely use cases, for example, to play music composed in trackers that do not have a replayer (e.g. Oracle), or was made for a different platform. I am thinking about adding a record-to-VGM export function to Synthesix as well.

Van Manuel

Ascended (15763)

afbeelding van Manuel

31-03-2015, 20:39

If it's so efficient, why wouldn't all trackers have some kind of rendering/compiling feature to VGM?
Or, perhaps emulators could be used to retro-implement that...

Van l_oliveira

Hero (529)

afbeelding van l_oliveira

31-03-2015, 20:48

Manuel wrote:

If it's so efficient, why wouldn't all trackers have some kind of rendering/compiling feature to VGM?
Or, perhaps emulators could be used to retro-implement that...

Considering the origin of the VGM format, the first emulators to adhere to the standard were the ones related to SEGA video games.

Van Grauw

Ascended (8457)

afbeelding van Grauw

31-03-2015, 23:30

Manuel wrote:

If it's so efficient, why wouldn't all trackers have some kind of rendering/compiling feature to VGM?
Or, perhaps emulators could be used to retro-implement that...

Yes it shouldn’t be too hard to create a VGM recording script supporting various sound chips for openMSX. Typically it’s done with modified emulator source code (some have it built-in), but tcl scripts make things quite easy. I think there was a link a few pages back to a little script to record the FM-PAC, shouldn’t be hard to adapt to support other chips.

VGM’s biggest limitation is that it’s not so efficient in space. For example all the Final Fantasy music combined is 872 kB (261 kB zipped), and Sonyc’s FM-PAC music is 401 kB (90 kB zipped). Both of these are 1-disk games. (I’m mentioning the zipped size because it indicates how much space can be saved by a gunzip-capable player.)

However, a lot of that space is used by wait commands. Because the Z80 and OP* sound chips are not so fast and VGM has a 44100 Hz precision, waits are inserted by the logger after nearly every register write. For music played back on the VDP interrupt, that isn’t really necessary… I just made a little test-tool which reduces the timer resolution to 60 Hz (by collapsing waits), turns out it cuts the file size by about 25%. The Final Fantasy music’s combined size is reduced to 643 kB (90 kB zipped), and Sonyc’s is reduced to 295 kB (16 kB zipped). Looks like this does wonders for the compression too Smile.

Knowing now how many waits are present in these VGMs, I should probably optimise that part of the code path a little more Smile.

Pagina 8/47
1 | 2 | 3 | 4 | 5 | 6 | 7 | | 9 | 10 | 11 | 12 | 13