Tracker Packer v2 format Created by Crazy Crack / MEXX (1993-1994) Analysed by Asle / ReDoX (asle@mygale.org) Source : - Three TP2 file sent by Gryzor (thx !) Note: Lots of new features, regarding the previous version which was rather good already !. The packing of the notes is one of the best I've seen so far as now. Really great packer ... though, I think Heatseeker is still better :). Offset size (byte) Comment ------ ----------- ------- 0 8 ID "MEXX_TP2" 8 20 (14h) title 28 2 (NOS) Number of sample (*8). Also, that's the size (1Ch) of the whole sample headers. *************************************** * the following is repeated NOS times * * with 8 bytes description for 1 smp * ****************************************************** * 30 1 Finetune (0 -> F) * (1Eh) * 31 1 Volume (0 - 40h) * (1Fh) * 32 2 Sample Size / 2 * (20h) * 34 2 Loop Start / 2 * (22h) * 36 2 Loop Size / 2 * (24h) * * ****************************************************** 30+8*NOS 1 ?!? ($00) 31+8*NOS 1 (PLS) Pattern list size. 32+8*NOS PLS*2 The pattern list. Each number of pattern is *8 !. 32+8*NOS NOP*8 (NOP stands for the REAL number of pattern which value +PLS*2 is known by getting the highest value in the previous table and by adding 1 since the first is 0) Track table per pattern. Each SAVED pattern is made of 4 tracks and here are the addresses of each track. This is a table of words. The first address is $0000!. To get the real track address, add to the present value : (34+8*NOS+2*PLS+NOP*8). 32+8*NOS 2 ?!? +PLS*2 +NOP*8 34+8*NOS ? Tracks datas. Each track is saved one after another. +PLS*2 It consists of 64 possible notes. the size of each +NOP*8 track is variable and is between 1 byte and 300h bytes. Here follows the whole lot of cases one can find in the track data (the note packing). case 1: value / \ | | 1100-0000 || if these bits are set, you have to bypass (80h - value) bytes for those are empty notes. case 2: -description bit set to 0 / | 1000-0000 0000-0000 | | | | | | \ / \ / | effect effect value \ -description bit set to 1 case 3: no effect 0000-0000 0000-0000 || | | | | / \ / \ / \/ | relative sample effect | note number | number |------------description bit set to 0 Note: effect, here, is EMPTY !. case 4: 0000-0000 0000-0000 0000-0000 || | | | | | | / \ / \ / \/ \ / | relative sample effect effect | note number value | number |------------description bit set to 0 Note: the first bit of 'relative note number' and the last of 'sample number' are the same but can only be used by the sample number because the note value is even ... thus, its first bit is never used. For all those cases: effect: the arpeggio (0) effect has been remapped to 8 Note that all the volume slide commands (5,6,A) are signed !. Here an example: A 01 -> A 10 A FF -> A 01 etc. .. relative note number: (Protracker) C-1 to B-1 : 856,808,762,720,678,640,604,570,538,508,480,453 C-2 to B-2 : 428,404,381,360,339,320,302,285,269,254,240,226 C-3 to B-3 : 214,202,190,180,170,160,151,143,135,127,120,113 becomes : (TP2) C-1 to B-1 : 02,04,06,08,0a,0c,0e,10,12,14,16,18 C-2 to B-2 : 1a,1c,1e,20,22,24,26,28,2a,2c,2e,30 C-3 to B-3 : 32,34,36,38,3a,3c,3e,40,42,44,46,48 Follows Sample datas stored like Protracker. Nothing is packed..