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-19 08:58
Radiant

Registered: Sep 2004
Posts: 639
Quoting Mr. SID
The idea is that the path name often changes. So the MD5 is a more robust way of identifying the file in question. So it's possible to extract the song length even if the file was not loaded from within the HVSC, as long as the MD5 is in the DB.

But why is calculating the MD5 value such an esoteric task? It should be really simple - right? If people are cheating their way around doing it then clearly something is wrong and the system should be redesigned.

I think the footer idea is good. It won't affect backwards compatibility in most cases, and in those cases where it will and upgrading is not an option, there are workarounds.
2011-02-19 10:40
JCB
Account closed

Registered: Jun 2002
Posts: 241
@rambones, a database would be an ok format for a PC/Mac (plenty of light cross platform options) but then you force slimmer devices (or people who don't require the whole HVSC) to take the entire db just to play a few files..

2011-02-19 12:40
Inge

Registered: Nov 2003
Posts: 144
I've made an example using XML, to point out how flexible it all can be done. Here, all STIL info and songlength info are a part of the file itself, making it much more easy to keep track of all info related to the songs.

One negative thing is that each SID-file will be 3-6 KB larger in size, but that should not be any problem unless you absolutely want to load the file directly in to the C64 memory.

<?xml version="1.0" encoding="UTF-8"?>
<SID type="RSID">
	<Header>
		<LoadAddress="0000">
		<InitAddress="4000">
		<PlayAddress="0000">
		<Songs="20">
		<StartSong="1">
		<Name="Arkanoid">
		<Author="Martin Galway">
		<Released="1987 Imagine">
		<RelocStart="0000">
		<RelocPages="00">
		<Flags>
			<!--   	0 = built-in music player,
					1 = Compute!'s Sidplayer MUS data, music player must be merged.	-->
			<Format="0">
			<!-- 	0 = C64 compatible,
					1 = PlaySID specific (PSID v2NG)
					2 = C64 BASIC flag (RSID) -->
			<Player="0">
			<!-- 	0 = Unknown,
					1 = PAL,
					2 = NTSC,
					3 = PAL and NTSC. -->
			<Clock="1">
			<!--	0 = Unknown,
					1 = MOS6581,
					2 = MOS8580,
					3 = MOS6581 and MOS8580 -->
			<SidModel="1">
		</Flags>
	</Header>
	<STIL>
		<Author>
			<Comment="Martin Galway's own comments are denoted (MG).
				'I will never do rearrangements of those tunes on other instruments,
				the SID is what they're meant to be heard on. It would not be
				'updating' them to put them onto a different instrument. If you ever
				hear music from me on today's instruments, the tunes will be all-new
				(and probably a lot better).' (MG)">
			</Comment>
		</Author>	
		<SID>
			<Comment="This is the very first published tune on the C64 that used samples.
				'I'm glad you spotted 'Cobra' on the Spectrum, whose tune I was in
				love with and HAD to use somewhere else...! I figured no-one would
				complain if I used it a year later on the C64.' (MG) (It got used in
				Arkanoid.)
				'Q: How did you get involved with using sampled sounds?
				MG: I figured out how samples were played by hacking into someone
				else's code... OK, I admit it... It was a drum synthesizer package
				called Digidrums, actually, so you could still say I was the first to
				include samples in a piece of music. [...] Never would I claim to have
				invented that technique, I just got it published first. In fact, I
				couldn't really figure out where they got the sample data, just that
				they were wiggling the volume register, so I tried to make up my own
				drum sample sounds in realtime - which is the flatulence stuff that
				shipped in 'Arkanoid'. [...] After the project was in the shops I
				gained access to some real drum samples, and I slid those into my own
				custom version of the tune. The one that's in the shops is kind of a
				collage of farts & burps, don't you think? [...] Later I was able to
				acquire some proper drum samples and by 'Game Over' it got quite
				sophisticated.' (MG)">
			</Comment>
		</SID>	
	</STIL>
	<Songs>
		<Song1>
			<Length="2:22">
			<STIL>
				<Title="Cobra (Title) [from the Spectrum game]">
				<Artist="Martin Galway">
				<Comment="'I'm glad you spotted 'Cobra' on the Spectrum, whose tune I was in
					love with and HAD to use somewhere else...! I figured no-one would
					complain if I used it a year later [for Arkanoid] on the C64.' (MG)">
			</STIL>
		</Song1>
		<Song2>
			<Length="1:17">
			<STIL>
				<Title="Hiscore [from the arcade game Arkanoid - Revenge of Doh]">
				<Artist="Hisayoshi Ogura (OGR/Zuntata)">
			</STIL>
		</Song2>
	</Songs>
	<Binary>
		(Binary code goes here)
	</Binary>
</SID>
2011-02-19 13:26
iAN CooG

Registered: May 2002
Posts: 3194
<Binary>
(Binary code goes here)
</Binary>

can a binary be included in a plain text xml? Shouldn't it be at least base64 encoded?
Besides converting hvsc to this format will mean to trash *all* existing programs and waiting to be accepted and fully supported. I don't see it forseeable in the near future, if even reading a single sldb txt file is so hard for someone to be implemented....

ps: this is only my opinion, I'm not stopping anyone from proposing ideas, but only ideas are not enough, I'm waiting for someone actually doing some new format with the needed tools to support it, and see if it's usable.
2011-02-19 19:46
pmprog
Account closed

Registered: Nov 2005
Posts: 54
TBH I'm not a fan of XML. I think it's overused, and definately not the best approach for this IMO. What with wanting to keep this small for memory constrained devices.

What I'll do then, I'll try and make a modified version of TitchySID and try a converter tool to take a PSIDv2, add the optional header and see what happens :-)
2011-02-19 20:30
iAN CooG

Registered: May 2002
Posts: 3194
make sure to encode it in brainfuck, so hexpattern searching will be REALLY complicated.
2011-02-19 22:18
pmprog
Account closed

Registered: Nov 2005
Posts: 54
I don't know, Piet is my preferred language
http://www.dangermouse.net/esoteric/piet/samples.html

Also Whitespace is good
https://secure.wikimedia.org/wikipedia/en/wiki/Whitespace_%28pr..

:-)
2011-02-20 09:30
MagerValp

Registered: Dec 2001
Posts: 1078
Quoting pmprog
TBH I'm not a fan of XML. I think it's overused, and definately not the best approach for this IMO. What with wanting to keep this small for memory constrained devices.


An IFF style format would work here. It supports most of the nice XML features (flexible, structured, future proof), but is fast and easy to parse. You'd keep the PSID header for backwards compatibility, and just bump the version number and add a pointer to the extended data, which is appended after the music data:

0000 PSID, with ptr to SIFF block, starting at 1100 here
007c data
1100 SIFF
1104 SIFF size
1108 TIME
110c TIME size
1110 4 bytes time info per subtune

and so on.
2011-02-20 09:46
pmprog
Account closed

Registered: Nov 2005
Posts: 54
MagerValp: Yep, that's the plan, I'm going to have to do some "real" work first, but should be easy enough to create a "converter" tool. I didn't want to call it v3 in the header as iAN said there's already a v3 in the works, so my version field will get set to 0x8002 (v2.5 ;-))

Once the converter is made, I'll create an updated version of TitchySID (just because I understand the source code). Then hopefully look at making an update to libsidplay (which would also let me recompile the Foobar2000 plugin, but after a quick look at the source code, I don't know where to start)
2011-02-20 13:48
pmprog
Account closed

Registered: Nov 2005
Posts: 54
Converter - PSID V2.5 Converter

The converter will also let you convert V2.5 PSIDs back to V2

Further down the line I'll add commandline support so it can be batched, but next task is onto a player...
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
ΛΛdZ
zscs
csabanw
rexbeng
FunFun/Triangle
Guests online: 120
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 Musicians
1 Rob Hubbard  (9.7)
2 Mutetus  (9.7)
3 Jeroen Tel  (9.7)
4 Linus  (9.6)
5 Stinsen  (9.6)

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