RMT (format pliku)

From Atariki

(Różnice między wersjami)
Jump to: navigation, search
Wersja z dnia 11:14, 16 sie 2011
Mono (Dyskusja | wkład)

← Previous diff
Aktualna wersja
Mono (Dyskusja | wkład)
(envelope command and distortion, instrument type and mode)
Linia 15: Linia 15:
07 BYTE format version number ($01 for player routine 1.x compatible format) 07 BYTE format version number ($01 for player routine 1.x compatible format)
08 WORD pointer to instrument pointers table 08 WORD pointer to instrument pointers table
-0a WORD pointer to tracks table (lo)+0a WORD pointer to track pointers table (lo)
-0c WORD pointer to tracks table (hi)+0c WORD pointer to track pointers table (hi)
0e WORD pointer to tracks list (SONG) 0e WORD pointer to tracks list (SONG)
Linia 34: Linia 34:
07 BYTE vmin(bit 4-7) 07 BYTE vmin(bit 4-7)
08 BYTE delay ($00 for no vibrato & no fshift) 08 BYTE delay ($00 for no vibrato & no fshift)
-09 BYTE vibrato+09 BYTE vibrato (0-3)
0a BYTE fshift 0a BYTE fshift
0b BYTE unused 0b BYTE unused
0c table of notes 0c table of notes
? envelope ? envelope
 +
 +ttype
 +-----
 +0 - notes
 +1 - freqs
 +
 +tmode
 +-----
 +0 - +
 +1 - +=
Linia 53: Linia 63:
command (bit 4-6), filter (bit 7) command (bit 4-6), filter (bit 7)
BYTE XY BYTE XY
 +
 +distortion
 +----------
 +0 - $0v
 +2 - $2v
 +4 - $4v
 +6 - $Cv 16-bit bass table tone
 +8 - $8v
 +A - $Av pure tone
 +C - $Cv bass 1 table tone
 +E - $Cv bass 2 table tone
 +
 +command
 +-------
 +0 - play BASE_NOTE + $XY semitones
 +1 - play frequency $XY
 +2 - play BASE_NOTE + frequency $XY
 +3 - set BASE_NOTE += $XY semitones; play BASE_NOTE
 +4 - set FSHIFT += frequency $XY; play BASE_NOTE
 +5 - set PORTAMENTO speed $X and step $Y; play BASE_NOTE
 +6 - set FILTER_SHFRQ += frequency $XY; play BASE_NOTE
 +7 - set BASE_NOTE = $XY; play BASE_NOTE / if $XY == $80 then VOLUMEONLY mode
Linia 60: Linia 92:
BYTE BYTE
bit 0-5 note bit 0-5 note
- bit 6-7 volume(HI) or pause(1-3 beats) or special+ bit 6-7 volume(LO) or pause(1-3 beats) or special
if note is $00-$3c: if note is $00-$3c:
BYTE BYTE
- bit 0-1 volume(LO)+ bit 0-1 volume(HI)
bit 2-7 instrument number bit 2-7 instrument number
if note is $3d: if note is $3d:
BYTE BYTE
- bit 0-1 volume(LO) volume only+ bit 0-1 volume(HI) volume only
if note is $3e: if note is $3e:
Linia 88: Linia 120:
WORD ptr_instr3 WORD ptr_instr3
... ...
 +
 +ptr_instr = 0 if instrument isn't used
TRACKS TABLE (LO) TRACKS TABLE (LO)
Linia 102: Linia 136:
BYTE highbyte_of_ptr_track2 BYTE highbyte_of_ptr_track2
... ...
 +
 +ptr_track = 0 if track isn't used
TRACK LIST struct (SONG) TRACK LIST struct (SONG)
Linia 115: Linia 151:
Note: gotoline(BYTE) is not used in player (but tracker uses it) Note: gotoline(BYTE) is not used in player (but tracker uses it)
</pre> </pre>
 +
 +Jeśli moduł nie jest "ogołocony" (opcja "Strip" w RMT), zaraz za głównym blokiem zawierającym moduł następuje drugi blok, w którym zapisane są:
 +* nazwa utworu (max. 64 znaki),
 +* nazwy instrumentów (max. 32 znaki każdy).
 +Każda nazwa kończy się zerem (ATASCII #0).
[[Kategoria:Emulacja]] [[Kategoria:Emulacja]]
[[Kategoria:Formaty plików]] [[Kategoria:Formaty plików]]

Aktualna wersja

RMT 1.x module format
--------------------------------


header struct
=============

offset	type	desc
------	----	----
00	DWORD	header string 'RMT4' or 'RMT8'
04	BYTE	track len ($00 means 256)
05	BYTE	song speed
06	BYTE	player freq
07	BYTE	format version number ($01 for player routine 1.x compatible format)
08	WORD	pointer to instrument pointers table
0a	WORD 	pointer to track pointers table (lo)
0c	WORD	pointer to track pointers table (hi)
0e	WORD	pointer to tracks list (SONG)


instrument struct
=================

offset	type	desc
------	----	----
00	BYTE	tlen (pointer to end of table of notes)
01	BYTE 	tgo (pointer to loop of table of notes)
02	BYTE	elen (pointer to end of envelope)
03	BYTE	ego (pointer to loop of envelope)
04	BYTE	tspd (bit 0-5), tmode (bit 6), ttype (bit 7)
05	BYTE	audctl
06	BYTE	vslide
07	BYTE	vmin(bit 4-7)
08	BYTE	delay ($00 for no vibrato & no fshift)
09	BYTE	vibrato (0-3)
0a	BYTE	fshift
0b	BYTE	unused
0c		table of notes
?		envelope

ttype
-----
0 - notes
1 - freqs

tmode
-----
0 - +
1 - +=


TABLE OF NOTES struct
=====================
	BYTE	note or frequence (according to the ttype)


ENVELOPE struct
===============
	BYTE	volume (bit 0-3 left channel) (bits 4-7 right channel
	      (in RMT4 it's the same as bits 0-3))
	BYTE	portamento (bit 0), distortion(bit 1-3),
	      command (bit 4-6), filter (bit 7)
	BYTE	XY

distortion
----------
0 - $0v
2 - $2v
4 - $4v
6 - $Cv 16-bit bass table tone
8 - $8v
A - $Av pure tone
C - $Cv bass 1 table tone
E - $Cv bass 2 table tone

command
-------
0 - play BASE_NOTE + $XY semitones
1 - play frequency $XY
2 - play BASE_NOTE + frequency $XY
3 - set BASE_NOTE += $XY semitones; play BASE_NOTE
4 - set FSHIFT += frequency $XY; play BASE_NOTE
5 - set PORTAMENTO speed $X and step $Y; play BASE_NOTE
6 - set FILTER_SHFRQ += frequency $XY; play BASE_NOTE
7 - set BASE_NOTE = $XY; play BASE_NOTE / if $XY == $80 then VOLUMEONLY mode


TRACK struct
============

BYTE
	bit 0-5	note
	bit 6-7	volume(LO) or pause(1-3 beats) or special

if note is $00-$3c:
BYTE
	bit 0-1	volume(HI)
	bit 2-7 instrument number

if note is $3d:
BYTE
	bit 0-1	volume(HI)	volume only

if note is $3e:
	bit 6-7 pause
	if pause is $01-$03:	pause 1-3 beats
	if pause is $00:	next byte pause 1-255 beats

if note is $3f:
	if bit 6-7 is zero: next byte speed $01-$ff
	if bit 6 is zero, 7 is set up: next byte is track jump pointer
	(go to $00-$ff from the begin of track data)
	if bit 6-7 is set up: END of track

INSTRUMENTS TABLE
=================
	WORD	ptr_instr0
	WORD	ptr_instr1
	WORD	ptr_instr3
	...

ptr_instr = 0 if instrument isn't used 

TRACKS TABLE (LO)
=================
	BYTE	lowbyte_of_ptr_track0
	BYTE	lowbyte_of_ptr_track1
	BYTE	lowbyte_of_ptr_track2
	...

TRACKS TABLE (HI)
=================
	BYTE	highbyte_of_ptr_track0
	BYTE	highbyte_of_ptr_track1
	BYTE	highbyte_of_ptr_track2
	...

ptr_track = 0 if track isn't used

TRACK LIST struct (SONG)
========================
	BYTE	tracknumL1,tracknumL2,tracknumL3,tracknumL4,[tracknumR1,..,tracknumR4]
	BYTE	tracknumL1,tracknumL2,tracknumL3,tracknumL4,[tracknumR1,..,tracknumR4]
	BYTE	tracknumL1,tracknumL2,tracknumL3,tracknumL4,[tracknumR1,..,tracknumR4]
	...

if tracknum is FF, then empty track is used

if tracknumL1 is FE, then gotoline(BYTE)=tracknumL2, goto_pointer(WORD)=(tracknumL3,4)
	Note: gotoline(BYTE) is not used in player (but tracker uses it)

Jeśli moduł nie jest "ogołocony" (opcja "Strip" w RMT), zaraz za głównym blokiem zawierającym moduł następuje drugi blok, w którym zapisane są:

  • nazwa utworu (max. 64 znaki),
  • nazwy instrumentów (max. 32 znaki każdy).

Każda nazwa kończy się zerem (ATASCII #0).

Personal tools