Reply to topic  [ 1 post ] 
TuComposer Track (TCT) file format specifications 
Author Message

Joined: 31. May 2005 05:23
Posts: 70
Location: Liège
Post TuComposer Track (TCT) file format specifications
TCT1 (TuComposer Track)
 ?FILE = Filename of track (e.g. MainPart.TCT)
 ?NAME = Name of track (e.g. Main-Part)
  THDR = Track header, contains important data.
         Offset    Size    Meanings
          + 0      UBYTE   Version number of track (currently 01)
          + 1      UBYTE   Revision number of track (currently 00)
          + 2      UWORD   Length of track in rows - 1 (to allow 65536)
          + 4      UBYTE   Track volume
          + 5      UBYTE   Track sub volume
          + 6      UBYTE   Track panning
          + 7      UBYTE   Track sub panning
          + 8      BYTE    Track Transpose
          + 9      UBYTE   Compatibility flags
                           Bit # | Meanings if set
                               0 | Ignore sample offsets beyond end of sample
                               1 | Share tone porta memory with portamentoes
                               2 | Portamentoes of same type share the same
                               3 | All except portamentoes slides share the
                                   same memory (just added for XM/MOD)
                               4 | Oppositional portamento directions don't
                                   share memories (e.g. porta up/porta down)
                               5 | Oppositional non-portamento slide
                                   directions don't share same memory
                               6 | Volume & Pitch slides share the same memory
                                   (just for S3M compatibility)
          +10      UWORD   Special flags:
                           Bit # | Meanings if set
                               0 | Unused currently. The tracker used it for
                                   redirection, but as it has been removed,
                                   this bit is free currently...
                               1 | Use track timing fields
                               2 | If bit #1 and this are set, SPD timing will
                                   be used, else BPM.
                               3 | Track panning used
                               4 | Surround track panning
                               5 | Play track backwards
          +12      UWORD   Track Tempo (default 6)
          +14      UBYTE   Speed multiplier (NULL or 1 if unused)
          +15      UBYTE   Speed divider (done after multiplier)
          +16      UWORD   SPD value (default 33)
          +18      UWORD   BPM Tempo (default 4)
          +20      UWORD   BPM value (default 125)
  BODY = Packed track data
         Decrunching the data works as follows:
          1. Read 1 mask byte.
          2. Check the bits in the following table:
             Bit # | Meanings
                 0 | HI-Byte of new row follows
                 1 | LO-Byte of new row follows
                 2 | Octave/Note follows
                 3 | Instrument HI-Byte follows
                 4 | Instrument LO-Byte follows
                 5 | Effect byte follows
                 6 | Data word HI-Byte follows
                 7 | Data word LO-Byte follows
          3. Check if bit #0 and #1 are set. If not, go to step 5
          4. Read (if bit #0 is set), the hi-byte of the new row and (if bit
             #1 is set, the new lo-byte of the row). If the lo-byte of the
             new row isn't set, assume it zero. If the hi-byte row is set,
             use this hi-byte until you get a new one. That means, the lo-byte
             should not affect the hi-byte in anyway. Now goto step 6
          5. Assume increase row by one after data read
          6. If bit #2 is clear goto step 7 else read Octave/Note byte.
             Octave is hi-nibble, note is lo-nibble. If octave nibble is $F,
             both nibbles should be put together and put into the note ($FF
             is note kill, $FE is note off, $FD is keyoff, $FC is hold delay
             and $FB is note fade and $F0 is patten END marker). If not, the
             note nibble with return 1 for C-, 2 for C#, 3 for D-, 4 for D#,
             5 for E-, 6 for F-, etc.
          7. If bit #3 and #4 are clear goto step 8 else read instrument
             HI-Byte (if bit #3 is set) and LO-Byte (if bit #4 is set).
             The non-read byte is assumed to be zero.
          8. If bit #5 isn't set but bit #6 or #7 then goto step 10.
          9. If bit #5 is set then read effect byte. If bit #7 of effect byte
             is set goto step 11. If none of the bits #5, #6 and #7 is set,
             then goto step 13.
         10. Test if bit #6 or #7 are set, if so read data word HI-Byte (if
             bit #6 is set), and data LO-Byte (if bit #7 is set). The non-read
             byte again is assumed to be zero. Goto step 13
         11. Look 10 but then goto step 12 instead of 13. Don't forget to
             mask out the 7th bit before putting it in the effect column.
         12. Read effect byte and data-word (no, following effect data isn't
             crunched). If the bit #7 of the new effect byte again is set,
             again goto 12. Don't forget to mask out the 7th bit after
             processing it.
         13. If that wasn't the last row, goto back to 1. I clear the byte
             after the last crunched byte and check only if the mask byte
             is zero.
         It may look very complicated, but no panic, it's nearly the same as
         S3M, etc., although much more effective (due to the row-bits).

1. June 2005 12:08
Profile ICQ WWW
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.