There are some songs that I like so much that I'd love if they looped 3 or 4 times, while the rest would remain looping just 2.
This is easy to do in some other music formats like SPC or MiniUSF that allow one to right-click -> View file info, on the Playlist Window of Winamp, in where one can change the length of the song directly. While In_VGM also shows a length box for the songs, one is unable to change it despite the blinking text cursor.
Other music formats like Module Tracker allow length editing by third party software (say, copying and pasting the part one likes to loop an extra time(s).)
I've been messing around trying to change the length of a song with VGMTool and vgm_spts, but I'm only able to make the songs shorter (say, loop once in a loop 2 times environment), not longer.
I'd like to know if there's a way to extend these VGZ music files, or a way to extend VGM music files (by choosing arbitrary length, or specifying some Loop "x times" that overrides default, or some other method.)
Extending VGZ files?
Technical discussion about the VGM format, and all the software you need to handle VGM files.
Moderator: Staff
Use vgm_ptch from the vgmtools.
Usage:
If it's an old VGM file (pre v1.51 for SetLoopMod or 1.60 for SetLoopBase) you will have to update it with the following command
then you can
This multiplies the loop count (notice hexadecimal notation, the actual loop modifier is a 4.4 fixed point value, or the value divided by 16).
OR
This subtracts a "base value" from the default loop count, so if set to -100 (Notice the negative value), and the default loop count is 2, it will loop 102 times.
SetLoopBase will add or subtract from the player's loop count preference, while SetLoopMod will multiply or divide this value.
Usage:
If it's an old VGM file (pre v1.51 for SetLoopMod or 1.60 for SetLoopBase) you will have to update it with the following command
Code: Select all
vgm_ptch -UpdateVer:1.51 myfile.vgm
Code: Select all
vgm_ptch -SetLoopMod:0x20 myfile.vgm
OR
Code: Select all
vgm_ptch -SetLoopBase:-100 myfile.vgm
SetLoopBase will add or subtract from the player's loop count preference, while SetLoopMod will multiply or divide this value.
- ValleyBell Offline
- Posts: 4791
- Joined: 2011-12-01, 20:20:07
- Location: Germany
If you don't want to use the hexadecimal notation, you can also use
Code: Select all
-SetLoopMod:*2.0 -> loop twice as often as set in the player's preferences
-SetLoopMod:/2.0 -> loop half as often as set in the player's preferences
Hi, finally got to try this out, did this really happen 4 years ago?
So, I'm trying to extend a song that is 1:11 to 1:40 or so, I updated it and tried both methods, it tells me:
But then when I add it to winamp it still shows 1:11 and it only plays by that much time, as if my "play two loops, fade 5 seconds" setting on VGM input plugin was overriding my changes, any other way to make this file play for longer?
So, I'm trying to extend a song that is 1:11 to 1:40 or so, I updated it and tried both methods, it tells me:
Code: Select all
File: BonusRace.vgz ...
SetLoopBase: -100
Info: Header resized - Old: 0x40 bytes, New: 0x80 bytes
File written.
- ValleyBell Offline
- Posts: 4791
- Joined: 2011-12-01, 20:20:07
- Location: Germany
37.30 (7.72 intro and 29.59 loop)ValleyBell wrote:
- What is the song length and loop length?
Hey, is there a way to use a Hex editor to modify the song's length directly? I think it'd solve all my problems without having to edit loop data.
VGM input plugin v0.50.1 (in_vgmW). The weird thing is that with the plugin I was using previously the song showed 1:11 as its length when added to Winamp's Library, but now this field appears empty (no length shown) though it plays fine. I'd still love if I could modify a song's length directly in the View file info...'s dialog like with Alpha-II's SPC input plugin.ValleyBell wrote:
- What version of in_vgm are you using?
- ValleyBell Offline
- Posts: 4791
- Joined: 2011-12-01, 20:20:07
- Location: Germany
Okay, I can confirm that in_vgm 0.51.0 is definitely buggy when it comes to the calculation of the reported song length.
It plays fine, but the reported song length when loading the file is wrong.
Example with the 3 files below (13.7 s loop, no intro):
In case of NSF/GBS/SPC/xSF files, you just have a tiny ROM that executes sound code with no information about song lengths, loops being available to the player from the "internal" data.
Such information is supplied using additional tags that you can freely define. (SPC/xSF lets you do this for example, but the original NSF and GBS formats do not.)
VGMs work more like WAV/MP3 in that regard: They are recordings of data and the VGM ripper determines song length and loop size by cutting the song at the appropriate places.
Playing the song once means "play all data from beginning to the end". Looping it means "when reaching the end, restart at a certain defined point".
From this you can determine the song and loop lengths very precisely, but you can't freely redefine them.
The players are generally limited to playing the VGM file once + playing the loop N times and will allow you to fade out only at the point where the VGM loops back. You can not play half of a loop, only full loops.
It plays fine, but the reported song length when loading the file is wrong.
Example with the 3 files below (13.7 s loop, no intro):
- drop into the playlist -> reported length is 0:32 for all
- play the 1st file -> reported length is 0:32
- then play the 2nd file -> reported length is 0:32, however it plays for 23:19 and the scroll bar indicates that as well
- then play the 2nd file again -> reported length is 23:19
- now play the 3rd file -> reported length is 23:19, but it plays for 1:54 only
- then play the 3rd file again -> reported length is 1:54
- when dropping the file into the playlist, default loop settings are assumed
- when loading the file, the playlist info assumes loop settings from the last song you played
I'm afraid that this doesn't work due to technical limitations of the VGM format.Yntec wrote:Hey, is there a way to use a Hex editor to modify the song's length directly? I think it'd solve all my problems without having to edit loop data.
In case of NSF/GBS/SPC/xSF files, you just have a tiny ROM that executes sound code with no information about song lengths, loops being available to the player from the "internal" data.
Such information is supplied using additional tags that you can freely define. (SPC/xSF lets you do this for example, but the original NSF and GBS formats do not.)
VGMs work more like WAV/MP3 in that regard: They are recordings of data and the VGM ripper determines song length and loop size by cutting the song at the appropriate places.
Playing the song once means "play all data from beginning to the end". Looping it means "when reaching the end, restart at a certain defined point".
From this you can determine the song and loop lengths very precisely, but you can't freely redefine them.
The players are generally limited to playing the VGM file once + playing the loop N times and will allow you to fade out only at the point where the VGM loops back. You can not play half of a loop, only full loops.
- Attachments
-
- Saboten Bombers_12 Unused 3_LoopMod_x4.vgm
- Loop Modifier set to *4.0
- (33.75 KiB) Downloaded 46 times
-
- Saboten Bombers_12 Unused 3_LoopBase_-100.vgm
- Loop Base set to -100
- (33.75 KiB) Downloaded 49 times
-
- Saboten Bombers_12 Unused 3_DefaultLoop.vgm
- no loop adjustments
- (33.75 KiB) Downloaded 41 times
Thank you, this was the information I needed. I thought about a feature request that would be very cool to have: Minimum song length, you set it to, say, 2 minutes, then if a song's length is below this, it just plays another loop, this way one doesn't need to extend VGZ files individually, if they're too short they loop more times, and one doesn't need to edit thousands of songs so they play for longer (my NSF files do this for 1:40, but of course if the song is longer it's cut short, VGZ files wouldn't have this problem as longer songs wouldn't be affected as they would already go over Minimum song length.)ValleyBell wrote:The players are generally limited to playing the VGM file once + playing the loop N times and will allow you to fade out only at the point where the VGM loops back. You can not play half of a loop, only full loops.
Just an idea.