Zen Packer format Created by Dweezil / Stellar (1992) Analysed by Asle / ReDoX (asle@mygale.org) Source : - five files sent by Gryzor (thx !) Note: Not much to do since Gryzor described this format fairly well in Prowiz. Offset size (byte) Comment ------ ----------- ------- 0 4 (PAT_ADDY) Address of the pattern table. 4 1 number of pattern (-1) 5 1 (SIZE) size of the pattern list (number of pattern to play) *************************************** * the following is repeated 31 times * * with 16 bytes description for 1 smp * ******************************************************* * 6 2 finetune (*48h) * * 8 2 volume * * 10 2 sample size / 2 * (0Ah) * 12 2 Loop size / 2 * (0Ch) * 14 4 sample address (in file) * (0Eh) * 18 4 loop start address (in file) * (12h) * * ******************************************************* 502 ? pattern data. Stored one after another, each one (1F6h) contains 4 tracks. pattern 1: row 1 : voice 1, voice 2, voice 3, voice 4 row 2 : voice 1, voice 2, voice 3, voice 4 row ... row 64: voice 1, voice 2, voice 3, voice 4 pattern 2: ... That's for the theory because all the notes are not saved !. One note is 4 bytes long and each pattern ends with $FF000000. So, a pattern size is between 4 and 1024 bytes. unused- Sample number \ / \ | | | 0000 0000 0000 0000 0000 0000 0000-0000 | | | | | | | | \ / \ / \/ \ / position relative effect effect number note value number Note: 'position number' is the position of the note in the pattern. The first value is 00. That way, empty notes are not saved since there are only the position with notes that are saved. Though, the last note (position = $FF) is always saved, whatever the note value is. Note: The relative note number is *2, and, therefore, the first bit is NEVER used by the note. 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 : (ZEN) 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 PAT_ADDY SIZE*4 Pattern table. It's the address of each pattern in the file (dword). The 'PAT_ADDY' is defined upward, as well as 'SIZE'. PAT_ADDY 4 $FFFFFFFF to mark the end of the pattern table .. +SIZE*4 I guess :). PAT_ADDY ? sample data +SIZE*4 +4