I suggest a way to solve this by tweaking a bit Martin Fernandez' header format. The header currently is as such:
- Code: Select all • Expand view
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 • Expand view
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?