\TFMX plugin v1.24 for Winamp2
(c) 1999-2001 Peter Pawlowski
http://www.blorp.com/~peter/

Based on TFMX player for Unix, written by Jonathan H. Pickard
http://www.antigates.com/~marxmarv/tfmx.html

This plug-in is freeware - you can use and redistribute it for no charge as long as it's unmodified and includes this text file. I do not take any responsibility for effects of running it.

This plug-in plays TFMX module files. If you don't know what TFMX is or have never seen an Amiga computer, you have downloaded the wrong plugin.

TFMX format and most of TFMX music was created by Chris Huelsbeck. Visit http://www.huelsbeck.com/ for more info; also check http://www.mp3.com/huelsbeck/ for a few modern remixes of most famous TFMX tunes. A lot of TFMX files can be downloaded from ExoticA - http://exotica.fix.no/ .

Primary purpose of this plugin is to play original TFMX game music. JHP's TFMX hack was structurally pretty good, but it contained several glitches which were completely screwing up the feel of some of my favourite songs; all other third-party TFMX players are based on it so they clone most of its bugs. I used modern hacking methods (recording music from games via Fellow + sample-level Cool Edit hacking + bigass debug log); I think I've killed most of these glitches. Even Turrican 1 Intro plays correctly now. Unfortunately, I am afraid that this plugin might be unable to correctly play some of TFMX files made by third parties.
Listening tests were performed mostly on files from Turrican 1/2/3, Apidya and Logical. T1 and T2 playback code is cloned nearly perfectly - there are no noticeable glitches, even for a hardcore Turrican freak (8| . I haven't noticed any weird behaviors while playing other files, but I didn't listen to their original versions that much so I might have missed a few minor bugs. Some newer variations of TFMX format might not work as good as old ones do.

To avoid MDAT / SMPL mess and keep this stuff usable with modern media players (read: Winamp3), I've created new single file format for TFMX songs (yes, I know that there were others, but I'm too lazy to look for their specs; they probably don't support what I need anyway). You can merge MDAT/SMPL files using 'merge' command in file info box (available only while playing). New files have .TFM extension and allow you to store various info (artist, game, comments, subsong titles and lengths, etc).
Old there used to be standalone MDAT/SMPL merger proggie, but it's now integrated with the plugin. It's still available at http://www.blorp.com/~peter/zips/tfmx_cvt.zip (source code included if you want to support this format).

There is no TFMX subsong length autodetection (yes, I'm lazy). Use TFM stuff to set subsong lengths manually (SPC-like). Setting subsong lengths will also allow you to use seeking.

Some songs will require you to convert to .TFM and configure some stuff before you can play them correctly. If you are listening to Turrican 1 chpitunes, make sure that you select 'old' compatibility option in TFM info box (there are more games which require this, typical symptoms are messed up music data (like T1 intro via other TFMX players) or too fast / too slow portamento). Some really freaky files (eg. Logical) will require you to mute troublemaking channels (in subsong info box). For JHP's music, select 'emulate other TFMX players' option for max compatibility.
Note that there's an internal database of potentially troublemaking files; compatibility option should be autodetected in most cases (will play correctly w/o converting to .TFM and automatically set compatibility option while converting).

Decompression is supported (via read_file.dll).
TIP: if you want to have all subsongs as separate playlist entries, you can copy .TFM file around and set different default song in every copy, then RAR them up and use <archive.rar\file> syntax (eg. "c:\tunez\turrican.rar\world3.tfm") - RAR's solid compression will cut out multiple copies of the same data. (you will probably need the latest read_file.dll from my website for this trick, the one which is now in Winamp setup does only one_archive->one_file decompression).

version history:
v1.0
 - initial release
v1.1
 - fixed TFMX_CVT (converted to GUI to avoid some weird behaviors of win2k OS; fixed broken sample file detection)
 - added interpolation config & cubic mode (v1.0 version used linear mode all time)
 - added 'surround mode'
 - added micro volume ramping (check the heartbeat on T2 level 5.1 with best interpolation ;)
v1.11
 - fixed evil clicks on some files (most noticeable: Turrican 3 world 3 / Air Combat)
 - fixed pattern jumps in Masterblazer intro
v1.12
 - Turrican3-specific hacks now have new compatibility option to prevent them from messing up other songs
v1.13
 - fixed note-off on T3 level 5
 - some tweaks in mixer (should be faster now)
v1.14
 - fixed lockups with some files (not sure if it's 100% correct fix, but it at least doesn't lock up anymore)
v1.2
 - integrated MDAT/SMPL merging code into the plugin (accessible from info box)
v1.21
 - better compatibility with old stuff (beefed up internal database, still incomplete)
v1.22
 - new title formatting logic
v1.23
 - updated title formatting
 - some speed hacks
v1.24
 - another title formatting update
 - some tweaks

Quick notes on settings:
- preamp - simple and cheap way to fix songs which sound too quiet.
- stereo separation - all TFMX channels are either 100% left or 100% right; modifying this setting allows you to place channels more close to center (makes big difference if you use headphones).
- 'Surround' mode - inverts right channel; does nothing if stereo separation is set to max
- resampling interpolation - there are three modes:
  - 'none' - similar to old TFMX players and some Amiga emulators, produces shitty high-frequency noise; some people might still like it (note: better use cubic mode & some DSP if you like high freqencies)
  - 'linear' - default, sounds much better than the first option and doesn't hurt your CPU
  - 'cubic' - select this one for max sound quality at cost of CPU usage (bah, CPU usage is 0% all the time even with max settings on my Athlon); it produces nice ultra-smooth PCM curve. make sure to enable this one if you convert to WAV/MP3/whatever.
- force infinite playback - ignores length / fadeout info on .TFM files
- play all subsongs - all configured TFM subsongs are played consecutively like one big song (you must configure subsong lengths in order to get what you want).
- play random subsong - plays random subsong (TFM only)
 *note: if both 'play all subsongs' and 'play random subsong' are off, the plugin will play the subsong you highlighted in TFM info box


Sorry folks, but I'm too lazy to release the source code (big question: does anyone else work on this stuff these days ?). There _will_ be Winamp3 port of this thing soon.