Community > Project / Coder's Corner

Zone 66 music conversion help

(1/4) > >>

Malvineous:
Hi all,

I'm working on a conversion utility for the music in the DOS game Zone 66.  I have successfully reverse engineered the file format (documented here) and converted it to ScreamTracker S3M format.  (I selected this format because it was one of the few that support both sampled and Adlib instruments.)

However, there are still a few unknowns and I'm wondering whether anyone here with a bit of tracking experience can offer some suggestions, as the format seems to share a lot of things with its contemporaries.


* The sampled instruments have their centre frequency as 33075Hz.  This is a number I guessed by listening, but it seems a bit high to me for a song from the early 90s.  The notes seem to be played in very low octaves, so I am wondering whether the song needs to be transposed and the frequency lowered.  Some of the pitches don't quite match what the game sounds like, but I've been listening to both correct and incorrect versions of the songs for so long now I can't really tell any more which is right and which isn't...!
* The "speed" is the only figure copied directly from the source file.  To play at the correct rate, the "tempo" has to be set to 144 or so.  This is another magic number which I came up with by twiddling until the drum loop in the title sequence looped fairly smoothly.  Is there something special about a tempo of 144? (0x90)  Is there a well known tempo value close to this that is probably more correct?
* Has anyone ever created a song that uses both Adlib and sampled instruments?  When I play these files in ScreamTracker the Adlib notes seem to play too soon relative to the sampled ones, but when I use SchismTracker they are fine.  But then SchismTracker seems to mangle some Adlib notes so I'm not sure.  Just looking for feedback as to whether there are any known issues with trackers/players in this respect.
* Some of the Adlib notes seem to play very quietly compared to the sampled ones, but this only seems to affect ScreamTracker.  SchismTracker seems ok.  Not sure which way is better...
If you'd like to take a look at the files, here are z66title2.s3m and  z66ep1v2.s3m.  If you're not familiar with the game, some recordings I made are available in Ogg Vorbis at VGMPF (the first two tracks - 101 Theme and 102 Foreign Shores - match the .s3m files.)

Any feedback would be much appreciated!

Saga Musix:

--- Quote from: Malvineous on July 13, 2014, 14:02:23 ---The sampled instruments have their centre frequency as 33075Hz.  This is a number I guessed by listening, but it seems a bit high to me for a song from the early 90s.  The notes seem to be played in very low octaves, so I am wondering whether the song needs to be transposed and the frequency lowered.
--- End quote ---
Well, the fact that the low octaves make up for the high sampling rate pretty much tells you already that your assumption of 33075 being the middle-C frquency is wrong. The original tracker that was used to create the songs (and thus, the CDFM format) may have had a completely different idea of what middle-C is than ST3 had - this is not a rare thing, e.g. C-2 in ProTracker is C-4 in ScreamTracker/Fasttracker, which in return is C-5 in Impulse Tracker.
Incidentally, 33075 is exactly two octaves above ProTracker's middle-C frequency, so you can safely assume that the octaves found in those files are ProTracker octaves and need to be transposed upwards by two octaves (and the sample frequency needs to be divided by 4) to map the CDFM middle-C to ScreamTracker's middle-C.


--- Quote ---The "speed" is the only figure copied directly from the source file.  To play at the correct rate, the "tempo" has to be set to 144 or so.  This is another magic number which I came up with by twiddling until the drum loop in the title sequence looped fairly smoothly.  Is there something special about a tempo of 144? (0x90)  Is there a well known tempo value close to this that is probably more correct?
--- End quote ---

I'm not sure about that one, but you may know that the CDFM format is somewhat related to 669 (made by the same person), which also has some magic numbers regarding tempo and speed which are different (tempo 78, speed 4) from those usually found in ProTracker-like formats (tempo 125, speed 6). It may simply be an idiosyncrasy he came up with while developing his player routines. One thing that could also come into play are PAL vs NTSC timing differences here.


--- Quote ---Has anyone ever created a song that uses both Adlib and sampled instruments?  When I play these files in ScreamTracker the Adlib notes seem to play too soon relative to the sampled ones, but when I use SchismTracker they are fine.
--- End quote ---
I wouldn't be surprised if that's a DOSBox issue. I can probably confirm this on a real machine if you really want it, though.


--- Quote ---Some of the Adlib notes seem to play very quietly compared to the sampled ones, but this only seems to affect ScreamTracker.  SchismTracker seems ok.  Not sure which way is better...
--- End quote ---
In the intro tune I'd even say that some of them are too loud in ScreamTracker, not too quiet. I'm sure this can depend on factors such as if ScreamTracker uses stereo or mono output.

BTW: Your updated conversions seem to lack the "pattern jump" command in the last patterns to jump to the correct restart position.

Thanks for the conversions, btw. I've been searching for this soundtrack in a "normal" mod format for years, I even asked CCCatch if he still has the files, and while he said that he'd have to look at his parents' place, I haven't heard back from him since then.

Malvineous:

--- Quote from: Saga Musix on July 13, 2014, 14:34:44 ---Well, the fact that the low octaves make up for the high sampling rate pretty much tells you already that your assumption of 33075 being the middle-C frquency is wrong. The original tracker that was used to create the songs (and thus, the CDFM format) may have had a completely different idea of what middle-C is than ST3 had - this is not a rare thing, e.g. C-2 in ProTracker is C-4 in ScreamTracker/Fasttracker, which in return is C-5 in Impulse Tracker.
--- End quote ---

Aha, that's what I am missing!  Sorry, despite listening to mods for years, this is my first attempt at actually trying to work with them!  I didn't realise the idea of what middle-C is varied so much.  Suddenly explains why the Halloween Harry/Alien Carnage songs were all a couple of octaves too low...


--- Quote ---Incidentally, 33075 is exactly two octaves above ProTracker's middle-C frequency, so you can safely assume that the octaves found in those files are ProTracker octaves and need to be transposed upwards by two octaves (and the sample frequency needs to be divided by 4) to map the CDFM middle-C to ScreamTracker's middle-C.

--- End quote ---

While this makes perfect sense, it raises more questions!  I transposed the notes up by two octaves and set the frequency to 8268 and it sounds really good.  I tried 8363 too but it was off-key, so is 8268 a ProTracker default?  I can't seem to find a mention of this at present.

However this now transposes all the Adlib instruments up by two octaves!  I put an exception in the converter to only transpose notes on the sampled channels and this seems to produce the right output, but does seem a bit weird the two instrument types would use different middle-C notes.  See what you think: z66ep1v3.s3m z66title3.s3m.  Perhaps I should be transposing Adlib notes too but adjusting the middle-C frequency for those instruments?  But by only transposing the sampled notes they all end up around similar octaves so maybe this is best...  (Incidentally if you know of any documentation explaining how the ST3 middle-C frequency is applied to Adlib instruments I could really use it!)


--- Quote ---I'm not sure about that one, but you may know that the CDFM format is somewhat related to 669 (made by the same person), which also has some magic numbers regarding tempo and speed which are different (tempo 78, speed 4) from those usually found in ProTracker-like formats (tempo 125, speed 6). It may simply be an idiosyncrasy he came up with while developing his player routines. One thing that could also come into play are PAL vs NTSC timing differences here.

--- End quote ---

Oh wow that's amazing, I had no idea!  For some reason I assumed .669 was an old format from the Amiga, I didn't realise it was a PC tracker!  And by Renaissance!  Feeling stupid now :-)  At least it helps explain some magic numbers.


--- Quote ---I wouldn't be surprised if that's a DOSBox issue. I can probably confirm this on a real machine if you really want it, though.

--- End quote ---
Oh thanks for the offer, you could be right there.  I do have a few DOS machines around so I'll save you the effort and try it next time one is plugged in.


--- Quote ---In the intro tune I'd even say that some of them are too loud in ScreamTracker, not too quiet. I'm sure this can depend on factors such as if ScreamTracker uses stereo or mono output.

--- End quote ---

Yes I thought the same thing about the intro tune, but some of the others are really quiet.  Have a listen to z66ep3v3.s3m, the "twinkly" Adlib is so quiet.  Maybe the 0-15 volume doesn't translate linearly to S3M's 0-63?  Not sure how you would go about testing that...


--- Quote ---BTW: Your updated conversions seem to lack the "pattern jump" command in the last patterns to jump to the correct restart position.

Thanks for the conversions, btw. I've been searching for this soundtrack in a "normal" mod format for years, I even asked CCCatch if he still has the files, and while he said that he'd have to look at his parents' place, I haven't heard back from him since then.

--- End quote ---

Oh you've seen my earlier attempts?!  They were hacky as I had to hard-code the offsets of each pattern, but now I have rewritten everything from scratch to handle patterns correctly.  Once I've gotten everything sorted I'll gladly put up a link to the fully converted soundtrack if you'd like.

The pattern jump I added by hand previously but I'm in two minds whether I should put it in automatically.  It complicates the conversion because you could theoretically have the last pattern played twice, but you would only want the jump command the second time the pattern was played.  So you'd have to duplicate the pattern just to add the jump command, which no longer matches the original song...  I think I will leave it out and it's something that can be added by hand along with titles for a "curated" conversion.

Saga Musix:

--- Quote from: Malvineous on July 13, 2014, 15:46:59 ---While this makes perfect sense, it raises more questions!  I transposed the notes up by two octaves and set the frequency to 8268 and it sounds really good.  I tried 8363 too but it was off-key, so is 8268 a ProTracker default?  I can't seem to find a mention of this at present.
--- End quote ---
8287 would be the default for PAL machines. I think 8363 comes from NTSC, and you must be aware here that some formats (even on PC) use the PAL constant as a base, others use the NTSC constant. Frequency calculation in Screamtracker is for example slightly different than what you would do in a classic ProTracker module. Which calculations is the exactly correct one can of course only be figured out by having the original tracker, or by directly comparing the game's audio output with a render from e.g. ST3.


--- Quote from: Malvineous on July 13, 2014, 15:46:59 ---However this now transposes all the Adlib instruments up by two octaves!  I put an exception in the converter to only transpose notes on the sampled channels and this seems to produce the right output, but does seem a bit weird the two instrument types would use different middle-C notes.
--- End quote ---
Well, as said, concepts are all but standardized between trackers, so it's possible that PCM middle-C doesn't match up but OPL interpretation is the same? I'm not really familiar with OPL instruments in ST3 so I don't even know if they have a concept of a variable middle-C pitch.


--- Quote from: Malvineous on July 13, 2014, 15:46:59 ---(Incidentally if you know of any documentation explaining how the ST3 middle-C frequency is applied to Adlib instruments I could really use it!)
--- End quote ---
Would the original ASM mixer code be of help? :)


--- Quote from: Malvineous on July 13, 2014, 15:46:59 ---Yes I thought the same thing about the intro tune, but some of the others are really quiet.  Have a listen to z66ep3v3.s3m, the "twinkly" Adlib is so quiet.  Maybe the 0-15 volume doesn't translate linearly to S3M's 0-63?  Not sure how you would go about testing that...
--- End quote ---
Yeah, it's probably yet another thing that could only be confirmed with the original tracker. Or maybe you could create a test music file to replace the original music file and see how it translates things in-game?


--- Quote from: Malvineous on July 13, 2014, 15:46:59 ---Oh you've seen my earlier attempts?!  They were hacky as I had to hard-code the offsets of each pattern, but now I have rewritten everything from scratch to handle patterns correctly.  Once I've gotten everything sorted I'll gladly put up a link to the fully converted soundtrack if you'd like.
--- End quote ---
Sure, that would be cool. I think I saw your first attempts on the SchismTracker board, and even pointed out some errors back then which have been fixed in the meantime.


--- Quote from: Malvineous on July 13, 2014, 15:46:59 ---The pattern jump I added by hand previously but I'm in two minds whether I should put it in automatically.  It complicates the conversion because you could theoretically have the last pattern played twice, but you would only want the jump command the second time the pattern was played.  So you'd have to duplicate the pattern just to add the jump command, which no longer matches the original song...  I think I will leave it out and it's something that can be added by hand along with titles for a "curated" conversion.

--- End quote ---
Yeah, I do understand the difficulty of doing this programatically. I just assumed that you did it that way before since neither in the intro nor the level 1 music you'd have to duplicate any patterns.

Jay:
Thanks for doing this! I've wanted to poke around with these tunes in module form for ages as well. Really cool to see how they're made; definitely post some updates here when you've got them!


--- Quote from: Malvineous on July 13, 2014, 14:02:23 ---Has anyone ever created a song that uses both Adlib and sampled instruments?  When I play these files in ScreamTracker the Adlib notes seem to play too soon relative to the sampled ones, but when I use SchismTracker they are fine.  But then SchismTracker seems to mangle some Adlib notes so I'm not sure.  Just looking for feedback as to whether there are any known issues with trackers/players in this respect.

--- End quote ---

They seem to play fine on my setup, no apparent timing problems... I'm using a GUS for digital playback and an SB for FM (ST3 can use both at the same time if they are installed together - theoretically this should work under Dosbox too, but who knows.) I also tried in 'pure' SB mode and didn't hear any problems.

Foreign Shores (z66ep1v3.s3m) has an FM snare layered with a sampled snare - they should (and do) hit at exactly the same time. Best test I could think of.

I can record the output from my machine for you if it helps. Let me know.

Old OPL2 chips on SB cards are notoriously slow to respond but I didn't think that extended to *music timing*... I'm using an AWE64 with Creative's CQM FM chip.

I think Manwe/Sands has some tracks up on Youtube using simultaneous FM+samples.

Navigation

[0] Message Index

[#] Next page

Go to full version