IMF header version 2

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: IMF header version 2

Re: IMF header version 2

by Graf Zahl » Sun Feb 26, 2017 12:52 pm

Do people actually use these formats? I don't, I do not even have any of them lying around so someone else will have to do this.

Re: IMF header version 2

by edward850 » Mon Sep 14, 2015 12:05 am

Alt idea the third: A $imfrate <lump> <rate> parameter introduced in [wiki]SNDINFO[/wiki]? From what I can tell, most IMFs need volume balancing anyway, so you already need an SNDINFO entry for them.

Re: IMF header version 2

by Blzut3 » Sun Sep 13, 2015 10:36 pm

Editing someone else's header seems a little risky to me. I wonder if a safer solution would be to detect based on the game name? Possibly also support some string there like "Generic: 700Hz"? The plus side is that existing playback utilities would continue to play the files.

Re: IMF header version 2

by Yholl » Sun Sep 13, 2015 8:54 pm

All my yes.

TAKE ALL OF MY YES

Re: IMF header version 2

by HavoX » Sat Sep 12, 2015 11:25 am

I'm sold on this idea, just as long as it maintains backwards compatibility, as you said.

IMF header version 2

by Gez » Sat Sep 12, 2015 9:29 am

Okay, here's a proposal. As you know, the [wiki]IMF[/wiki] format does not allow to define the sample rate. ZDoom uses 700 hz for everything, but there are files that have a rate of 560 hz or 280 hz instead. This is occasionally a problem.

I suggest a way to solve this by tweaking a bit Martin Fernandez' header format. The header currently is as such:

Code: Select all

char[5] 	Signature (must be ADLIB)
uint8 	Version (must be 1 — this format has no other version)
char* 	Track name as a null-terminated string
char* 	Game name as a null-terminated string
byte 	Ignored unknown value, generally 1
uint32 	Track length (if 0: until end of file or null instruction) 
It could be modified as such while keeping backward compatibility:

Code: Select all

char[5] 	Signature, unchanged
uint8 	Version — 2
char* 	Track name, unchanged
char* 	Game name, unchanged
byte 		sample rate / 7 (so 40 for 280 hz, 80 for 560 hz, or 100 for 700 hz)
uint32 	Track length, unchanged 
If version is 1, keep using a fixed rate of 700. Code impact on ZDoom would be minimal. Editing tool support would happen pretty soon in SLADE 3. What do you think?

Top