Impulse Header Layout 0 1 2 3 4 5 6 7 8 9 A B C D E F ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 0000: ³'I'³'M'³'P'³'M'³ Song Name, max 26 characters, includes NULL ³ ÃÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÂÄÄÄ´ 0010: ³.......................................................³ x ³ x ³ ÃÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÅÄÄÄÅÄÄÄ´ 0020: ³OrdNum ³InsNum ³SmpNum ³PatNum ³ Cwt/v ³ Cmwt ³ Flags ³ x ³ x ³ ÃÄÄÄÂÄÄÄÅÄÄÄÂÄÄÄÅÄÄÄÂÄÄÄÅÄÄÄÂÄÄÄÅÄÄÄÂÄÄÄÅÄÄÄÂÄÄÄÅÄÄÄÂÄÄÄÅÄÄÄÅÄÄÄ´ 0030: ³GV ³MV ³IS ³IT ³Sep³(0)³ x ³ x ³ x ³ x ³ x ³ x ³ x ³ x ³ x ³ x ³ ÃÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄ´ 0040: ³ Chnl Pan (64 bytes)...........................................³ ÃÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ´ ÃÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄ´ 0080: ³ Chnl Vol (64 bytes)...........................................³ ÃÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ´ ÃÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄ´ 00C0: ³ Orders, Length = OrdNum ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ xxxx: ³ 'Long' Offset of instruments, Length = InsNum*4 (1) ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ xxxx: ³ 'Long' Offset of samples headers, Length = SmpNum*4 (2) ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ xxxx: ³ 'Long' Offset of patterns, Length = PatNum*4 (3) ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ (1) Offset = 00C0h+OrdNum (2) Offset = 00C0h+OrdNum+InsNum*4 (3) Offset = 00C0h+OrdNum+InsNum*4+SmpNum*4 Cwt: Created with tracker. Impulse Tracker 1.0 = 0100h (256 dec) Cmwt: Compatible with tracker with version greater than value. OrdNum: Number of orders in song. InsNum: Number of instruments in song SmpNum: Number of samples in song PatNum: Number of patterns in song Flags: Bit 0: On = Stereo, Off = Mono Bit 1: Vol0MixOptimizations - If on, no mixing occurs if the volume at mixing time is 0 Bit 2: On = Use instruments, Off = Use samples. Bit 3: On = Linear slides, Off = Amiga slides. GV: Global volume. (0->128) All volumes are adjusted by this MV: Mix volume (0->128) During mixing, this value controls the magnitude of the wave being mixed. IS: Initial Speed of song. IT: Initial Tempo of song Sep: Panning separation between channels (0->128, 128 is max sep.) Chnl Vol: Volume for each channel. Ranges from 0->64 Chnl Pan: Each byte contains a panning value for a channel. Ranges from 0 (absolute left) to 64 (absolute right). 32 = central pan, 100 = Surround sound. +128 = disabled channel (notes will not be played) Orders: This is the order in which the patterns are played. Valid values are from 0->199. 255 = "---", End of song marker 254 = "+++", Skip to next order Impulse Instrument Format 0 1 2 3 4 5 6 7 8 9 A B C D E F ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 0000: ³'I'³'M'³'P'³'I'³ DOS FileName (12345678.123) ³ ÃÄÄÄÅÄÄÄÅÄÄÄÅÄÄÄÅÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ´ 0010: ³00h³Flg³VLS³VLE³SLS³SLE³ x ³ x ³FdO³ x ³NNA³DNC³ x ³ x ³ x ³ x ³ ÃÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄ´ 0020: ³ Instrument Name, max 26 bytes, includes NUL...................³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ´ 0030: ³.......................................³ x ³ x ³ x ³ x ³ x ³ x ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄ´ 0040: ³ Note-Sample/Keyboard Table, Length = 240 bytes................³ ÃÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ´ ÃÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄ´ 0130: ³ Volume envelope (200 bytes)...................................³ ÃÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ´ ÃÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄ´ 01F8: ³ Node points (25x2 bytes)......³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ Flg: Bit 0. On = Use volume envelope Bit 1. On = Use volume loop Bit 2. On = Use sustain volume loop VLS: Volume loop start VLE: Volume loop end SLS: Sustain loop start SLE: Sustain loop end FdO: FadeOut Fade applied when: 1) Note fade NNA is selected and triggered (by another note) 2) Note off NNA is selected with no volume envelope or volume envelope loop 3) Volume envelope end is reached DNC: Duplicate note check NNA: New note action: 0 = Note cut 1 = Note off 2 = Note continue (only for non looped samples, a looped sample will be faded) 3 = Note fade Note-Sample/Keyboard Table. Each note of the instrument is first converted to a sample number and a note (C-0 -> B-9). These are stored as sample/note byte pairs Volume envelope: Values from 0->64, 0FFh indicating end of envelope. (after which note fade applies) Node data: Tick THEN magnitude Impulse Sample Format 0 1 2 3 4 5 6 7 8 9 A B C D E F ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 0000: ³'I'³'M'³'P'³'S'³ DOS Filename (12345678.123) ³ ÃÄÄÄÅÄÄÄÅÄÄÄÅÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ 0010: ³00h³GvL³Flg³Vol³ Sample Name, max 26 bytes, includes NUL.......³ ÃÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÂÄÄÄ´ 0020: ³.......................................................³ x ³ x ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÁÄÄÄÁÄÄÄ´ 0030: ³ Length ³ Loop Begin ³ Loop End ³ C5Speed ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ´ 0040: ³ SusLoop Begin ³ SusLoop End ³ SamplePointer ³ViS³ViD³ViR³ViT³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ The cache file has the following pieces of information added on: 0 1 2 3 4 5 6 7 8 9 A B C D E F ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 0050: ³ File Size ³ Date ³ Time ³Fmt³...........................³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÁÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ Fmt. 0 = unchecked. 1 = directory, 2 = it sample, 3 = st sample GvL: Global volume for instrument, ranges from 0->64 Flg: Bit 0. On = sample associated with header. Bit 1-3. Reserved Bit 4. On = Use loop Bit 5. On = Use sustain loop Bit 6. On = Ping Pong loop, Off = Forwards loop Bit 7. On = Ping Pong Sustain loop, Off = Forwards Sustain loop Vol: Default volume for instrument Length: Length of sample } LoopBeg: Start of loop } Only the lower 2 bytes of Loop End: Byte AFTER end of loop } these values are used C5Speed: Number of bytes a second for C-5 } IT 1.0 SusLBeg: Start of sustain loop } SusLEnd: Byte AFTER end of sustain loop } SmpPoint: 'Long' Offset of sample in file. ViS: Vibrato Speed, ranges from 0->64 ViD: Vibrato Depth, ranges from 0->64 ViT: Vibrato waveform type. 0=Sine wave 1=Ramp down 2=Square wave 3=Random (speed is irrelevant) ViR: Vibrato Rate, rate at which vibrato is applied (0->64) Impulse Pattern Format 0 1 2 3 4 5 6 7 8 9 A B C D E F ÚÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 0000: ³Length ³ Rows ³ x ³ x ³ x ³ x ³ Packed data................ ³ ÃÄÄÄÂÄÄÄÅÄÄÄÂÄÄÄÅÄÄÄÅÄÄÄÅÄÄÄÅÄÄÄÅÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ´ Length: Length of packed pattern, not including the 8 byte header Rows: Number of rows in this pattern (Ranges from 32->200) Patterns are unpacked by the following pseudocode... GetNextChannelMarker: Read byte into channelvariable. if(channelvariable = 0) then end of row Channel = (channelvariable-1) & 63 if(channelvariable & 128) then read byte into maskvariable else maskvariable = previousmaskvariable for current channel if(maskvariable & 1), then read note. (byte value) // Note ranges from 0->119 (C-0 -> B-9) // 255 = note off, 254 = notecut if(maskvariable & 2), then read instrument (byte value) // Instrument ranges from 1->99 if(maskvariable & 4), then read volume (byte value) // Volume ranges from 0->64 if(maskvariable & 8), then read command (byte value) and commandvalue // Valid ranges from 0->31 (A=1, B=2, C=3, etc.) if(maskvariable & 16), then note = lastnote for channel if(maskvariable & 32), then instrument = lastinstrument for channel if(maskvariable & 64), then volume = lastvolume for channel if(maskvariable & 128), then { command = lastcommand for channel and commandvalue = lastcommandvalue for channel } Goto GetNextChannelMarker