Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > CSDb Discussions > Track Times in SID files?
2011-02-17 21:33
pmprog
Account closed

Registered: Nov 2005
Posts: 54
Track Times in SID files?

I've always wondered this, but why doesn't any of the SID file formats support a track time.

A couple of extra bytes per subtune per SID wouldn't be a huge loss, and it would mean any individual player doesn't need access to the 3MB file from HVSC to correctly know when to move on to the next track.

Given the database exists, it would also be pretty easy to write a program to go through all the files in HVSC, check if they match whichever SID file format supports the tracks times, and updates them with the tune lengths from the text file.

Does that not seem a good idea?
 
... 68 posts hidden. Click here to view all posts....
 
2011-02-20 19:21
MagerValp

Registered: Dec 2001
Posts: 1078
So how about this: the new format would allow any number of info chunks at the end, after the music data. Each chunk has a 4-byte ASCII name, followed by a 32-bit big endian unsigned integer of the length of its data (optionally: align all chunks, and round all lengths up to the nearest 4 bytes). The benefit of a format like this is that:

* Old players will just ignore the data at the end and can play new files.
* New players can parse and use the chunks they recognize.
* Unknown chunks can be ignored.
* As the format progresses you can add more chunks, and files stay compatible. Players can opt in to new features.

Suggested chunks:

* 2SID: Stereo SID info, two words for model and address
* STIL: STIL data
* TIME: One uint32 for each subtune with the number of frames that it should play. Flag if the tune repeats or stops.
* BUGS: Bug data

2011-02-20 20:42
Mr. SID

Registered: Jan 2003
Posts: 424
Quoting MagerValp

* TIME: One uint32 for each subtune with the number of frames that it should play. Flag if the tune repeats or stops.


It really should be a 16bit second count. Frames is not really usable, because in emulator libraries such as libsidplay2 you don't really know how many frames have passed. RSID tunes are basically just programs that run, the emulator does not call INIT/PLAY but just runs a full C64 program (PLAY is usually $0000 in this case).
2011-02-20 21:36
iAN CooG

Registered: May 2002
Posts: 3194
indeed, not counting those sids that have irregular CIA timings (there are plenty) and those with timed play call, one every 5 calls for example.
2011-02-21 10:59
Frantic

Registered: Mar 2003
Posts: 1648
...but I am quite sure that the majority of tunes in HVSIDS have a duration that aligns evenly with a certain number of frames, but not with an even number of seconds? Easy conclusion: frames is a better choice.

One could also specify various alternative time formats that would fit different kinds of tunes better, I guess, but if one should go for one single duration time format, I cannot see why number of frames is not the best choice. The arguments provided so far did not convince. They sounded more like "hey, there is this exception to what you said, so what you said does not make sense at all." :)
2011-02-21 11:34
chatGPZ

Registered: Dec 2001
Posts: 11386
Quote:
As the format progresses you can add more chunks, and files stay compatible. Players can opt in to new features.

thats the "beauty" of a tag based format. everyone can invent their own new tags. AND THEY WILL. it could grow into something almost as awesome as id3 ! hell yeah! \o/ o_O
2011-02-21 12:06
Mr. SID

Registered: Jan 2003
Posts: 424
Quoting Frantic
...but I am quite sure that the majority of tunes in HVSIDS have a duration that aligns evenly with a certain number of frames, but not with an even number of seconds? Easy conclusion: frames is a better choice.


So how long is a frame?

1/50 seconds?
1/60 seconds?
1/50.12 seconds?

One second precision is more than enough for this purpose, and a 16 bit value would be sufficient then. If you want to waste 32 bits on the song length, you could just as well use microseconds which would be almost cycle accurate.
2011-02-21 12:48
Frantic

Registered: Mar 2003
Posts: 1648
??

The duration of a frame is not an unknown value, and NTSC versus PAL is specified in the header anyway. The closer the value is to the real duration of a frame the better, of course.

For pal...
985248 / 312 / 63 = 50,1245421....

Use as many decimals as you like. :)

I find it quite disturbing when Deliplayer (on windows) cuts in the middle of a beat and things like that, when playing various amiga formats where the songlength can only be specified in seconds. I mean.. it is not that the unit of a frame is so wonderful as such. It is just that I fail to see why seconds would be better, since there is no inherent relation between "seconds" and the units of time that usually underly SID tunes. To me it is obviously more clean to cut the tune where it is in fact ending, rather than half a second off or so. Half a second is quite a noticeable duration when it comes to sound.
2011-02-21 12:49
Sasq

Registered: Apr 2004
Posts: 156
CHUNKs is the way to go for sure. But I don't think trying to keep it compatible with the old format is a good idea, it may break things, and what's the point? If you're still using an old player chances are you're still using the old format files. And it's easy enough to add the format to the important players once it gets accepted.

The only problem with putting STIL into the file is the author-info; A bit unfortunate to have to duplicate the same information in every song by the same Author.

Also if we are worried about size, we can always use 16 or 8-bit tags where it fits, and actually end up with smaller files in many cases, like so;
"XSID", $????????
"IN", $0026 // Info (always $60 bytes in PSID)
"A", $04, "Drax" // Author
"N", $0a ,"Test Music" // Name
"C", $15, "198x Maniacs of Noise" // Copyright
"FL", $????  // Flags
...
"DA", $???? // Data
...

But that is probably not worth the extra complexity...

2011-02-21 13:01
Frantic

Registered: Mar 2003
Posts: 1648
Couldn't edit the last post when I was supposed to add:

...but I do agree that milli/micro-seconds would be more or less equivalent to frames for most practical purposes. Whole seconds, no...
2011-02-21 19:35
MagerValp

Registered: Dec 2001
Posts: 1078
OK, so an uint32 for the number of clock cycles that the tune should play. Divide by 985248 to get the number of seconds for PAL, or 1022727 for NTSC. Songs that cut mid-beat annoy me too. The only drawback I can come up with is that you get a max of 72 minutes.

@groepaz: Social media style tags have nothing to do with this. The format specification would define chunks and their meaning.
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Paulko64
zscs
iceout/Avatar/HF
Peacemaker/CENSOR/Hi..
Guests online: 101
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 Fungus  (9.8)
5 S!R  (9.8)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.052 sec.