Files: 91e07c37ef88e4b9783f5a51c82e0e614f615a64 / src / syntrax / syntrax.h
7312 bytesRaw
1 | |
2 | |
3 | |
4 | |
5 | |
6 | //---------------------------prototypes------------------------ |
7 | void mixChunk(int16_t *outBuff, uint playbackBufferSize); |
8 | void pausePlay(void); |
9 | void resumePlay(void); |
10 | void reset(void); |
11 | void newSong(void); |
12 | |
13 | //----------------------------typedefs------------------------- |
14 | |
15 | typedef unsigned uint; |
16 | |
17 | //----------------------------defines-------------------------- |
18 | |
19 | |
20 | |
21 | |
22 | |
23 | |
24 | |
25 | |
26 | |
27 | |
28 | |
29 | |
30 | //some constants for controlling stuff |
31 | //I've no idea what the abreviations stand for |
32 | |
33 | |
34 | |
35 | |
36 | //---------------------------structures------------------------ |
37 | //player structs |
38 | //don't pack these |
39 | struct Voice |
40 | { |
41 | int wavelength; |
42 | int gainDelay; |
43 | int delta; |
44 | int freq; |
45 | int isSample; |
46 | int isPlayingBackward; |
47 | int smpLoopEnd; |
48 | int PPMXBYLQ; //unused |
49 | int gain; |
50 | int16_t *waveBuff; |
51 | int hasBidiLoop; |
52 | int synthPos; |
53 | int gainRight; |
54 | int smpLoopStart; |
55 | int bkpSynthPos; |
56 | int sampPos; |
57 | int gainLeft; |
58 | int hasLoop; |
59 | int smpLength:; |
60 | int gainDelayRight; |
61 | int gainDelayLeft; |
62 | int hasLooped; |
63 | }; |
64 | |
65 | struct VoiceEffect |
66 | { |
67 | int VMBNMTNBQU; |
68 | int TIPUANVVR; |
69 | double MDTMBBIQHRQ; |
70 | double YLKJB; |
71 | double DQVLFV; |
72 | int MFATTMREMVP; |
73 | double ILHG; |
74 | double RKF; |
75 | int SPYK; |
76 | int QOMCBTRPXF; |
77 | int ABJGHAUY; |
78 | }; |
79 | |
80 | struct TuneChannel |
81 | { |
82 | int JOEEPJCI; |
83 | int BNWIGU; |
84 | int isPlayingBackward; |
85 | int ELPHLDR; |
86 | int panning; |
87 | int TVORFCC; |
88 | int EYRXAB; //rather unused |
89 | int UHYDBDDI; |
90 | int XESAWSO; |
91 | int hasBidiLoop; |
92 | int fmDelay; |
93 | int volume; |
94 | int ACKCWV; |
95 | int sampPos; |
96 | int insNum; |
97 | int EQMIWERPIF; |
98 | int freq; |
99 | int HFRLJCG; |
100 | int VNVJPDIWAJQ; |
101 | int hasLoop; |
102 | int LJHG; |
103 | int16_r *sampleBuffer; |
104 | //SQUASH effect overflows into next buffer |
105 | //SE_MAXCHANS * 0x100 + 1 must be allocated |
106 | int16_t *synthBuffers; |
107 | int smpLoopStart; |
108 | int smpLoopEnd; |
109 | int hasLooped; |
110 | VoiceEffect effects[4]; |
111 | }; |
112 | |
113 | |
114 | //data structs |
115 | |
116 | |
117 | struct InstrumentEffect |
118 | { |
119 | uint32_t destWave; |
120 | uint32_t srcWave1; |
121 | uint32_t srcWave2; |
122 | uint32_t oscWave; |
123 | uint32_t variable1; |
124 | uint32_t variable2; |
125 | uint32_t fxSpeed; |
126 | uint32_t oscSpeed; |
127 | uint32_t effectType; |
128 | int8_t in5oscSelect; |
129 | int8_t resetEffect; |
130 | int16_t UNK00; |
131 | } PACKED; |
132 | |
133 | |
134 | |
135 | struct Instrument |
136 | { |
137 | int16_t version; |
138 | char name[32]; |
139 | int16_t waveform; |
140 | int16_t wavelength; |
141 | int16_t masterVolume; |
142 | int16_t amWave; |
143 | int16_t amSpeed; |
144 | int16_t amLoopPoint; |
145 | int16_t finetune; |
146 | int16_t fmWave; |
147 | int16_t fmSpeed; |
148 | int16_t fmLoopPoint; |
149 | int16_t fmDelay; |
150 | int16_t arpIndex; |
151 | uint8_t m_ResetWave[SE_MAXCHANS]; |
152 | int16_t panWave; |
153 | int16_t panSpeed; |
154 | int16_t panLoopPoint; |
155 | int16_t UNK00; |
156 | int16_t UNK01; |
157 | int16_t UNK02; |
158 | int16_t UNK03; |
159 | int16_t UNK04; |
160 | int16_t UNK05; |
161 | InstrumentEffect effects[4]; |
162 | //why do we even need to store a full path? |
163 | //only filename appears to be used. |
164 | char smpFullImportPath[192]; |
165 | uint32_t UNK06; |
166 | uint32_t UNK07; |
167 | uint32_t UNK08; |
168 | uint32_t UNK09; |
169 | uint32_t UNK0A; |
170 | uint32_t UNK0B; |
171 | uint32_t UNK0C; |
172 | uint32_t UNK0D; |
173 | uint32_t UNK0E; |
174 | uint32_t UNK0F; |
175 | uint32_t UNK10; |
176 | uint32_t UNK11; |
177 | int16_t UNK12; |
178 | int16_t shareSmpDataFromInstr; //0 is off |
179 | int16_t hasLoop; |
180 | int16_t hasBidiLoop; |
181 | uint32_t smpStartPoint; |
182 | uint32_t smpLoopPoint; |
183 | uint32_t smpEndPoint; |
184 | uint32_t hasSample; |
185 | uint32_t smpLength; |
186 | int16_t synthBuffers[SE_MAXCHANS][0x100]; |
187 | } PACKED; |
188 | |
189 | |
190 | |
191 | struct Row |
192 | { |
193 | uint8_t note; |
194 | uint8_t dest; |
195 | uint8_t instr; |
196 | int8_t spd; |
197 | uint8_t command; |
198 | } PACKED; |
199 | |
200 | |
201 | |
202 | struct Order |
203 | { |
204 | int16_t patIndex; //0 means empty |
205 | int16_t patLen; |
206 | } PACKED; |
207 | |
208 | |
209 | |
210 | struct Subsong |
211 | { |
212 | uint32_t UNK00[16]; |
213 | //UNK00 is used for something. No idea what. |
214 | //There is a sequence to the data in it. |
215 | //zeroing it out with hex editor doesn't seem to break stuff with Jaytrax |
216 | //it could as well be uninitialized memory |
217 | uint8_t mutedChans[SE_MAXCHANS]; |
218 | uint32_t tempo; |
219 | uint32_t groove; |
220 | uint32_t startPosCoarse; |
221 | uint32_t startPosFine; |
222 | uint32_t endPosCoarse; |
223 | uint32_t endPosFine; |
224 | uint32_t loopPosCoarse; |
225 | uint32_t loopPosFine; |
226 | int16_t isLooping; |
227 | char m_Name[32]; |
228 | int16_t channelNumber; |
229 | uint16_t delayTime; |
230 | uint8_t chanDelayAmt[SE_MAXCHANS]; |
231 | int16_t amplification; |
232 | int16_t UNK01; |
233 | int16_t UNK02; |
234 | int16_t UNK03; |
235 | int16_t UNK04; |
236 | int16_t UNK05; |
237 | int16_t UNK06; |
238 | int16_t UNK07; |
239 | //if my eyes don't deceive me, this actually happens |
240 | //waste of space |
241 | Order orders[SE_MAXCHANS][0x100]; |
242 | } PACKED; |
243 | |
244 | |
245 | |
246 | struct SongHeader |
247 | { |
248 | uint16_t version; |
249 | uint16_t UNK00; |
250 | uint32_t patNum; |
251 | uint32_t subsongNum; |
252 | uint32_t instrNum; |
253 | uint32_t UNK01; |
254 | int16_t UNK02; |
255 | int16_t UNK03; |
256 | int16_t UNK04; |
257 | int16_t UNK05; |
258 | int16_t UNK06; |
259 | int16_t UNK07; |
260 | int16_t UNK08; |
261 | int16_t UNK09; |
262 | int16_t UNK0A; |
263 | int16_t UNK0B; |
264 | int16_t UNK0C; |
265 | int16_t UNK0D; |
266 | int16_t UNK0E; |
267 | int16_t UNK0F; |
268 | int16_t UNK10; |
269 | int16_t UNK11; |
270 | } PACKED; |
271 | |
272 | |
273 | |
274 | //no need to pack |
275 | struct Song |
276 | { |
277 | SongHeader h; |
278 | int8_t arpTable[0x100]; |
279 | |
280 | Row *rows; |
281 | //we don't know what maximum pat name length should be |
282 | //in fact this is probably a buffer overflow target in Syntrax(app crashed on too long name, from UI); |
283 | uint32_t *patNameSizes; |
284 | char **patternNames; |
285 | Instrument *instruments; |
286 | Subsong *subsongs; |
287 | int16_t **samples; |
288 | }; |
289 | |
290 |
Built with git-ssb-web