-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathexport_data_format.txt
189 lines (148 loc) · 5.73 KB
/
export_data_format.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
STMF - SAA1099Tracker Module Format is fully relocable and pointer based,
focusing on shortest data length. All pointers in header are offsets from the
0th byte of data.
== HEADER =====================================================================
===============================================================================
0. | DWORD signature: "STMF"
1. | BYTE file version number and complexity of used commands in BCD code
(current format specification is 1.0 = 0x10 + value of cmd complexity)
5. | WORD pointer to sample pointer list
7. | WORD pointer to ornament pointer list
9. | WORD pointer to pattern pointer list
11. | WORD pointer to position data
(this sequence is defined only if title or author are specified)
13. | BYTE delimiter: CR = 0x0D
| STRING: module title (if title is specified)
| STRING: " by " + module author (if title & author are specified)
| BYTE delimiter: CR = 0x0D
== POINTER LISTS ==============================================================
===============================================================================
Nx | WORD pointers to samples
Nx | WORD pointers to ornaments
Nx | WORD pointers to patterns
== POSITION DATA ==============================================================
===============================================================================
0. | position length
1. | default position speed
2. | CH1 | pattern number
3. | CH1 | signed pitch-shift
4. | CH2 | pattern number
5. | CH2 | signed pitch-shift
6. | CH3 | pattern number
7. | CH3 | signed pitch-shift
8. | CH4 | pattern number
9. | CH4 | signed pitch-shift
10. | CH5 | pattern number
11. | CH5 | signed pitch-shift
12. | CH6 | pattern number
13. | CH6 | signed pitch-shift
...
?. | 0 - end of position table
| WORD pointer to loop position
(or 0 for no loop)
== PATTERN DATA ===============================================================
===============================================================================
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|
0. | 1 | X | X | X | X | X | X | X | # bit.7 set for controller byte
|---|---|---|---|---|---|---|---|
...
|---|---|---|---|---|---|---|---|
1. | 0 | T | T | T | T | T | T | T | # bit.7 not set for pattern data
|---|---|---|---|---|---|---|---|
2. | V | P | N | S | S | S | S | S |
|---|---|---|---|---|---|---|---|
...
|---|---|---|---|---|---|---|---|
(3) | C | C | C | C | O | O | O | O |
|---|---|---|---|---|---|---|---|
(4) | R | R | R | R | L | L | L | L |
|---|---|---|---|---|---|---|---|
(5) | D | D | D | D | D | D | D | D |
|---|---|---|---|---|---|---|---|
X - controller:
[0 - 126] - 1 to 127 of non-changing lines
[127] - end of pattern
T - tone number:
[0] - no change
[1 - 96] - tones (C-1 - B-8)
[127] - release flag
S - sample number:
[0] - no change
[1 - 31] - samples (1 - V)
N - no changing sample/ornament/command:
[1] - nothing more than note was changed (S = 0)
O - ornament number:
[0] - no change
[1 - 15] - ornaments (1 - F)
P - ornament release:
[1] - release current ornament
C - command:
[0] - no change
[1 - 15] - description in "commands.txt"
V - volume change flag
[1] - channel volume will be changed
L \ _ volume change value
R / (if V flag is set)
D - data for command (if C command isn't null)
- only exception is command Bxx - BREAK CURRENT PATTERN AND LOOP FROM LINE
when the data for command is stored in word as signed negative offset
(in bytes, calculated by compiler from byte which follows after that word)
and it points to particular trackline chosen by user. In this case,
controller byte of end of the pattern which should follow is ommited.
== ORNAMENT DATA ==============================================================
===============================================================================
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|
1. | C | D | D | D | D | D | D | D |
|---|---|---|---|---|---|---|---|
C - control flag
[0] - ornament data
[1] - controller
D - ornament data:
[003] - +3 semitones
[123] - -5 semitones
- controller:
[000] - end of ornament
[125] - set cursor to -3 lines back and continue (loop)
== SAMPLE DATA ================================================================
===============================================================================
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|
0. | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
|---|---|---|---|---|---|---|---|
...
|---|---|---|---|---|---|---|---|
1. | 0 | M | N | N | L | L | L | L |
|---|---|---|---|---|---|---|---|
2. | E | H | H | H | R | R | R | R |
|---|---|---|---|---|---|---|---|
3. | F | F | F | F | F | F | F | F |
|---|---|---|---|---|---|---|---|
...
|---|---|---|---|---|---|---|---|
END | 1 | C | C | C | C | C | C | C |
|---|---|---|---|---|---|---|---|
E - frequency enable bit
M - noise enable bit
N - noise generetor frequency:
[0] - 31.25 kHz
[1] - 15.6 kHz
[2] - 7.8 kHz
[3] - controlled by frequency from channel 1 / 4
L - left channel amplitude
R - right channel amplitude
H - octave shift (in two's complement):
[1] - +1 octave
[0] - base octave
[6] - -2 octaves
F - frequency shift in octave:
[158] - +158 cents
[158] - -98 cents (depends on significancy of H)
C - controller:
[000] - end of sample
[114] - set cursor to -14 lines back and continue (loop)
0th byte is present only in releasable sample
and then, sample consists of two different and playable parts:
- 1st part ends with repeat controller byte (> 128)
- 2nd part ends with controller end of sample (= 128)