Commit 8c0fa11

Nick Faro committed on
WIP new file format
commit 8c0fa11067c96f758b2224e04d0ce133083d950d parent 9af31a8
9 changed files +363−232
Deletedbeepboximport.pas +0−55
@@ -1,55 +0,0 @@
1 unit BeepBoxImport;
2
3 {$mode objfpc}{$H+}
4
5 interface
6
7 uses
8 Classes, SysUtils, fpjson, Song, hugedatatypes, constants;
9
10 function LoadSongFromBeepBoxJsonStream(Stream: TStream): TSong;
11
12 implementation
13
14 procedure TranscribePattern(BBPat: TJSONObject; Pat: PPattern);
15 var
16 Notes: TJSONArray;
17 I: Integer;
18 NoteVal, TickStart, TickEnd: Integer;
19 begin
20 Notes := TJSONArray(BBPat.FindPath('notes'));
21 for I := 0 to Notes.Count-1 do begin
22 NoteVal := Notes[I].FindPath('pitches[0]').AsInteger - C_5;
23 TickStart := Notes[I].FindPath('points[0].tick').AsInteger;
24 TickEnd := Notes[I].FindPath('points[1].tick').AsInteger;
25
26 with Pat^[TickStart] do begin
27 Note := NoteVal;
28 Instrument := 1;
29 EffectCode := $0;
30 EffectParams.Value := $00;
31 end;
32
33 with Pat^[TickEnd] do begin
34 EffectCode := $E;
35 EffectParams.Value := $00;
36 end;
37 end;
38 end;
39
40 function LoadSongFromBeepBoxJsonStream(Stream: TStream): TSong;
41 var
42 jData: TJSONData;
43 jObject: TJSONObject;
44 begin
45 jData := GetJSON(Stream);
46 jObject := TJSONObject(jData);
47
48 InitializeSong(Result);
49 Result.TicksPerRow := 6;
50 TranscribePattern(TJSONObject(jObject.FindPath('channels[0].patterns[0]')), Result.Patterns.GetOrCreateNew(0));
51 TranscribePattern(TJSONObject(jObject.FindPath('channels[1].patterns[0]')), Result.Patterns.GetOrCreateNew(1));
52 end;
53
54 end.
55
Modifiedcodegen.pas +6−1
@@ -273,9 +273,14 @@ begin
273 for J := Low(TNoiseMacro) to High(TNoiseMacro) do 273 for J := Low(TNoiseMacro) to High(TNoiseMacro) do
274 SL.Add(IntToStr(Instruments[I].NoiseMacro[J])); 274 SL.Add(IntToStr(Instruments[I].NoiseMacro[J]));
275 end 275 end
276 else 276 else begin
277 for J := Low(AsmInstrument) to High(AsmInstrument) do 277 for J := Low(AsmInstrument) to High(AsmInstrument) do
278 SL.Add(IntToStr(AsmInstrument[J])); 278 SL.Add(IntToStr(AsmInstrument[J]));
279 SL.Add('0');
280 SL.Add('0');
281 SL.Add('0');
282 SL.Add('0');
283 end;
279 284
280 WriteStr(TypePrefix, Instruments[I].Type_); 285 WriteStr(TypePrefix, Instruments[I].Type_);
281 ResultSL.Add(Format('%s%s: db %s', [TypePrefix, 'inst' + IntToStr(I), 286 ResultSL.Add(Format('%s%s: db %s', [TypePrefix, 'inst' + IntToStr(I),
ModifiedhUGEDriver +1−1
@@ -1 +1 @@
1 Subproject commit cc0867436a2081be481fad87163dda409b5521f9 1 Subproject commit 5be1ebaaecb35d7618fc4bb88526ba5026b7c81f
ModifiedhUGETracker.lpi +10−8
@@ -200,9 +200,16 @@
200 <OpenInFileMan Value="True"/> 200 <OpenInFileMan Value="True"/>
201 </PublishOptions> 201 </PublishOptions>
202 <RunParams> 202 <RunParams>
203 <local>
204 <CommandLineParams Value="&quot;C:\Projects\GB-Stuff\uge\Resources\Sample Songs\raphaelgoulart - The Murderous Funk Machine (intro).uge&quot;"/>
205 </local>
203 <FormatVersion Value="2"/> 206 <FormatVersion Value="2"/>
204 <Modes Count="1"> 207 <Modes Count="1">
205 <Mode0 Name="default"/> 208 <Mode0 Name="default">
209 <local>
210 <CommandLineParams Value="&quot;C:\Projects\GB-Stuff\uge\Resources\Sample Songs\raphaelgoulart - The Murderous Funk Machine (intro).uge&quot;"/>
211 </local>
212 </Mode0>
206 </Modes> 213 </Modes>
207 </RunParams> 214 </RunParams>
208 <RequiredPackages Count="5"> 215 <RequiredPackages Count="5">
@@ -222,7 +229,7 @@
222 <PackageName Value="LCL"/> 229 <PackageName Value="LCL"/>
223 </Item5> 230 </Item5>
224 </RequiredPackages> 231 </RequiredPackages>
225 <Units Count="26"> 232 <Units Count="25">
226 <Unit0> 233 <Unit0>
227 <Filename Value="hUGETracker.lpr"/> 234 <Filename Value="hUGETracker.lpr"/>
228 <IsPartOfProject Value="True"/> 235 <IsPartOfProject Value="True"/>
@@ -350,15 +357,10 @@
350 <UnitName Value="hUGESettings"/> 357 <UnitName Value="hUGESettings"/>
351 </Unit23> 358 </Unit23>
352 <Unit24> 359 <Unit24>
353 <Filename Value="beepboximport.pas"/>
354 <IsPartOfProject Value="True"/>
355 <UnitName Value="BeepBoxImport"/>
356 </Unit24>
357 <Unit25>
358 <Filename Value="dmfimport.pas"/> 360 <Filename Value="dmfimport.pas"/>
359 <IsPartOfProject Value="True"/> 361 <IsPartOfProject Value="True"/>
360 <UnitName Value="DMFImport"/> 362 <UnitName Value="DMFImport"/>
361 </Unit25> 363 </Unit24>
362 </Units> 364 </Units>
363 </ProjectOptions> 365 </ProjectOptions>
364 <CompilerOptions> 366 <CompilerOptions>
Modifiedhugedatatypes.pas +18−4
@@ -40,18 +40,32 @@ type
40 False: (Value: Byte); 40 False: (Value: Byte);
41 end; 41 end;
42 42
43 TCell = packed record 43 TCellV1 = packed record
44 Note: Integer; 44 Note: Integer;
45 Instrument: Integer; 45 Instrument: Integer;
46 EffectCode: Integer; 46 EffectCode: Integer;
47 EffectParams: TEffectParams; 47 EffectParams: TEffectParams;
48 end; 48 end;
49
50 TCellV2 = packed record
51 Note: Integer;
52 Instrument: Integer;
53 Volume: Integer;
54 EffectCode: Integer;
55 EffectParams: TEffectParams;
56 end;
57
58 TCell = TCellV2;
49 PCell = ^TCell; 59 PCell = ^TCell;
50 60
51 TPattern = packed array[0..63] of TCell; 61 TPatternV1 = packed array[0..63] of TCellV1;
52 PPattern = ^TPattern; 62 PPaternV1 = ^TPatternV1;
63
64 TPatternV2 = packed array[0..63] of TCellV2;
65 TPattern = TPatternV2;
66 PPattern = ^TPatternV2;
53 67
54 //TPatternMap = specialize TFPGMap<Integer, PPattern>; 68 TPatternMapV1 = specialize TFPGMap<Integer, PPatternV1>;
55 TPatternMap = class(specialize TFPGMap<Integer, PPattern>) 69 TPatternMap = class(specialize TFPGMap<Integer, PPattern>)
56 function GetOrCreateNew(Key: Integer): PPattern; 70 function GetOrCreateNew(Key: Integer): PPattern;
57 function MaxKey: Integer; 71 function MaxKey: Integer;
Modifiedsong.pas +93−26
@@ -22,7 +22,7 @@ type
22 22
23 TicksPerRow: Integer; 23 TicksPerRow: Integer;
24 24
25 Patterns: TPatternMap; 25 Patterns: TPatternMapV1;
26 OrderMatrix: TOrderMatrix; 26 OrderMatrix: TOrderMatrix;
27 end; 27 end;
28 28
@@ -38,7 +38,7 @@ type
38 38
39 TicksPerRow: Integer; 39 TicksPerRow: Integer;
40 40
41 Patterns: TPatternMap; 41 Patterns: TPatternMapV1;
42 OrderMatrix: TOrderMatrix; 42 OrderMatrix: TOrderMatrix;
43 43
44 Routines: TRoutineBank; 44 Routines: TRoutineBank;
@@ -52,11 +52,11 @@ type
52 Comment: ShortString; 52 Comment: ShortString;
53 53
54 Instruments: TInstrumentCollectionV1; 54 Instruments: TInstrumentCollectionV1;
55 Waves: TWaveBankV2; 55 Waves: TWaveBank;
56 56
57 TicksPerRow: Integer; 57 TicksPerRow: Integer;
58 58
59 Patterns: TPatternMap; 59 Patterns: TPatternMapV1;
60 OrderMatrix: TOrderMatrix; 60 OrderMatrix: TOrderMatrix;
61 61
62 Routines: TRoutineBank; 62 Routines: TRoutineBank;
@@ -69,12 +69,12 @@ type
69 Artist: ShortString; 69 Artist: ShortString;
70 Comment: ShortString; 70 Comment: ShortString;
71 71
72 Instruments: TInstrumentCollectionV2; 72 Instruments: TInstrumentCollection;
73 Waves: TWaveBankV2; 73 Waves: TWaveBank;
74 74
75 TicksPerRow: Integer; 75 TicksPerRow: Integer;
76 76
77 Patterns: TPatternMap; 77 Patterns: TPatternMapV1;
78 OrderMatrix: TOrderMatrix; 78 OrderMatrix: TOrderMatrix;
79 79
80 Routines: TRoutineBank; 80 Routines: TRoutineBank;
@@ -82,6 +82,24 @@ type
82 82
83 TSongV5 = TSongV4; // no structural differences 83 TSongV5 = TSongV4; // no structural differences
84 84
85 TSongV6 = packed record
86 Version: Integer;
87
88 Name: ShortString;
89 Artist: ShortString;
90 Comment: ShortString;
91
92 Instruments: TInstrumentCollection;
93 Waves: TWaveBank;
94
95 TicksPerRow: Integer;
96
97 Patterns: TPatternMap;
98 OrderMatrix: TOrderMatrix;
99
100 Routines: TRoutineBank;
101 end;
102
85 { TSong } 103 { TSong }
86 104
87 TSong = TSongV5; 105 TSong = TSongV5;
@@ -96,6 +114,7 @@ function UpgradeSong(S: TSongV1): TSong; overload;
96 function UpgradeSong(S: TSongV2): TSong; overload; 114 function UpgradeSong(S: TSongV2): TSong; overload;
97 function UpgradeSong(S: TSongV3): TSong; overload; 115 function UpgradeSong(S: TSongV3): TSong; overload;
98 function UpgradeSong(S: TSongV4): TSong; overload; 116 function UpgradeSong(S: TSongV4): TSong; overload;
117 function UpgradeSong(S: TSongV5): TSong; overload;
99 118
100 function OptimizeSong(const S: TSong): TSong; 119 function OptimizeSong(const S: TSong): TSong;
101 function PatternIsUsed(Idx: Integer; const Song: TSong): Boolean; 120 function PatternIsUsed(Idx: Integer; const Song: TSong): Boolean;
@@ -108,21 +127,21 @@ implementation
108 procedure ReadSongFromStreamV1(S: TStream; out ASong: TSongV1); 127 procedure ReadSongFromStreamV1(S: TStream; out ASong: TSongV1);
109 var 128 var
110 i, n: Integer; 129 i, n: Integer;
111 pat: PPattern; 130 pat: PPatternV1;
112 begin 131 begin
113 // Read the fixed elements first 132 // Read the fixed elements first
114 n := SizeOf(TSongV1) - SizeOf(TPatternMap) - SizeOf(TOrderMatrix); 133 n := SizeOf(TSongV1) - SizeOf(TPatternMapV1) - SizeOf(TOrderMatrix);
115 S.Read(ASong, n); 134 S.Read(ASong, n);
116 135
117 // Create the patterns 136 // Create the patterns
118 ASong.Patterns := TPatternMap.Create; 137 ASong.Patterns := TPatternMapV1.Create;
119 // Read the pattern count 138 // Read the pattern count
120 S.Read(n, SizeOf(Integer)); 139 S.Read(n, SizeOf(Integer));
121 for i:=0 to n - 1 do begin 140 for i:=0 to n - 1 do begin
122 // Allocate memory for each pattern ... 141 // Allocate memory for each pattern ...
123 New(pat); 142 New(pat);
124 // and read the pattern content 143 // and read the pattern content
125 S.Read(pat^, SizeOf(TPattern)); 144 S.Read(pat^, SizeOf(TPatternV1));
126 // Add the pattern to the list 145 // Add the pattern to the list
127 ASong.Patterns.Add(i, pat); 146 ASong.Patterns.Add(i, pat);
128 end; 147 end;
@@ -142,25 +161,25 @@ end;
142 procedure ReadSongFromStreamV2(S: TStream; out ASong: TSongV2); 161 procedure ReadSongFromStreamV2(S: TStream; out ASong: TSongV2);
143 var 162 var
144 i, n: Integer; 163 i, n: Integer;
145 pat: PPattern; 164 pat: PPatternV1;
146 begin 165 begin
147 // Read the fixed elements first 166 // Read the fixed elements first
148 n := SizeOf(TSongV2) 167 n := SizeOf(TSongV2)
149 - SizeOf(TPatternMap) 168 - SizeOf(TPatternMapV1)
150 - SizeOf(TOrderMatrix) 169 - SizeOf(TOrderMatrix)
151 - SizeOf(TRoutineBank); 170 - SizeOf(TRoutineBank);
152 171
153 S.Read(ASong, n); 172 S.Read(ASong, n);
154 173
155 // Create the patterns 174 // Create the patterns
156 ASong.Patterns := TPatternMap.Create; 175 ASong.Patterns := TPatternMapV1.Create;
157 // Read the pattern count 176 // Read the pattern count
158 S.Read(n, SizeOf(Integer)); 177 S.Read(n, SizeOf(Integer));
159 for i:=0 to n - 1 do begin 178 for i:=0 to n - 1 do begin
160 // Allocate memory for each pattern ... 179 // Allocate memory for each pattern ...
161 New(pat); 180 New(pat);
162 // and read the pattern content 181 // and read the pattern content
163 S.Read(pat^, SizeOf(TPattern)); 182 S.Read(pat^, SizeOf(TPatternV1));
164 // Add the pattern to the list 183 // Add the pattern to the list
165 ASong.Patterns.Add(i, pat); 184 ASong.Patterns.Add(i, pat);
166 end; 185 end;
@@ -183,25 +202,25 @@ end;
183 procedure ReadSongFromStreamV3(S: TStream; out ASong: TSongV3); 202 procedure ReadSongFromStreamV3(S: TStream; out ASong: TSongV3);
184 var 203 var
185 i, n: Integer; 204 i, n: Integer;
186 pat: PPattern; 205 pat: PPatternV1;
187 begin 206 begin
188 // Read the fixed elements first 207 // Read the fixed elements first
189 n := SizeOf(TSongV3) 208 n := SizeOf(TSongV3)
190 - SizeOf(TPatternMap) 209 - SizeOf(TPatternMapV1)
191 - SizeOf(TOrderMatrix) 210 - SizeOf(TOrderMatrix)
192 - SizeOf(TRoutineBank); 211 - SizeOf(TRoutineBank);
193 212
194 S.Read(ASong, n); 213 S.Read(ASong, n);
195 214
196 // Create the patterns 215 // Create the patterns
197 ASong.Patterns := TPatternMap.Create; 216 ASong.Patterns := TPatternMapV1.Create;
198 // Read the pattern count 217 // Read the pattern count
199 S.Read(n, SizeOf(Integer)); 218 S.Read(n, SizeOf(Integer));
200 for i:=0 to n - 1 do begin 219 for i:=0 to n - 1 do begin
201 // Allocate memory for each pattern ... 220 // Allocate memory for each pattern ...
202 New(pat); 221 New(pat);
203 // and read the pattern content 222 // and read the pattern content
204 S.Read(pat^, SizeOf(TPattern)); 223 S.Read(pat^, SizeOf(TPatternV1));
205 // Add the pattern to the list 224 // Add the pattern to the list
206 ASong.Patterns.Add(i, pat); 225 ASong.Patterns.Add(i, pat);
207 end; 226 end;
@@ -224,25 +243,25 @@ end;
224 procedure ReadSongFromStreamV4(S: TStream; out ASong: TSongV4); 243 procedure ReadSongFromStreamV4(S: TStream; out ASong: TSongV4);
225 var 244 var
226 i, n: Integer; 245 i, n: Integer;
227 pat: PPattern; 246 pat: PPatternV1;
228 begin 247 begin
229 // Read the fixed elements first 248 // Read the fixed elements first
230 n := SizeOf(TSongV4) 249 n := SizeOf(TSongV4)
231 - SizeOf(TPatternMap) 250 - SizeOf(TPatternMapV1)
232 - SizeOf(TOrderMatrix) 251 - SizeOf(TOrderMatrix)
233 - SizeOf(TRoutineBank); 252 - SizeOf(TRoutineBank);
234 253
235 S.Read(ASong, n); 254 S.Read(ASong, n);
236 255
237 // Create the patterns 256 // Create the patterns
238 ASong.Patterns := TPatternMap.Create; 257 ASong.Patterns := TPatternMapV1.Create;
239 // Read the pattern count 258 // Read the pattern count
240 S.Read(n, SizeOf(Integer)); 259 S.Read(n, SizeOf(Integer));
241 for i:=0 to n - 1 do begin 260 for i:=0 to n - 1 do begin
242 // Allocate memory for each pattern ... 261 // Allocate memory for each pattern ...
243 New(pat); 262 New(pat);
244 // and read the pattern content 263 // and read the pattern content
245 S.Read(pat^, SizeOf(TPattern)); 264 S.Read(pat^, SizeOf(TPatternV1));
246 // Add the pattern to the list 265 // Add the pattern to the list
247 ASong.Patterns.Add(i, pat); 266 ASong.Patterns.Add(i, pat);
248 end; 267 end;
@@ -265,10 +284,53 @@ end;
265 procedure ReadSongFromStreamV5(S: TStream; out ASong: TSongV5); 284 procedure ReadSongFromStreamV5(S: TStream; out ASong: TSongV5);
266 var 285 var
267 i, n, PatKey: Integer; 286 i, n, PatKey: Integer;
268 pat: PPattern; 287 pat: PPatternV1;
269 begin 288 begin
270 // Read the fixed elements first 289 // Read the fixed elements first
271 n := SizeOf(TSongV5) 290 n := SizeOf(TSongV5)
291 - SizeOf(TPatternMapV1)
292 - SizeOf(TOrderMatrix)
293 - SizeOf(TRoutineBank);
294
295 S.Read(ASong, n);
296
297 // Create the patterns
298 ASong.Patterns := TPatternMapV1.Create;
299 // Read the pattern count
300 S.Read(n, SizeOf(Integer));
301 for i:=0 to n - 1 do begin
302 // Read pattern key
303 S.Read(PatKey, SizeOf(Integer));
304 // Allocate memory for each pattern ...
305 New(pat);
306 // and read the pattern content
307 S.Read(pat^, SizeOf(TPatternV1));
308 // Add the pattern to the list
309 ASong.Patterns.Add(PatKey, pat);
310 end;
311
312 // Read the OrderMatrix
313 for i := 0 to 3 do
314 begin
315 // Read length of each OrderMatrix array
316 S.Read(n, SizeOf(Integer));
317 // Allocate memory for it
318 SetLength(ASong.OrderMatrix[i], n);
319 // Read content of OrderMatrix array
320 S.Read(ASong.OrderMatrix[i, 0], n*SizeOf(Integer));
321 end;
322
323 for I := Low(TRoutineBank) to High(TRoutineBank) do
324 ASong.Routines[I] := S.ReadAnsiString;
325 end;
326
327 procedure ReadSongFromStreamV6(S: TStream; out ASong: TSongV6);
328 var
329 i, n, PatKey: Integer;
330 pat: PPattern;
331 begin
332 // Read the fixed elements first
333 n := SizeOf(TSongV6)
272 - SizeOf(TPatternMap) 334 - SizeOf(TPatternMap)
273 - SizeOf(TOrderMatrix) 335 - SizeOf(TOrderMatrix)
274 - SizeOf(TRoutineBank); 336 - SizeOf(TRoutineBank);
@@ -310,7 +372,7 @@ var
310 i, n: Integer; 372 i, n: Integer;
311 begin 373 begin
312 // Write the fixed record elements first 374 // Write the fixed record elements first
313 n := SizeOf(TSongV5) 375 n := SizeOf(TSong)
314 - SizeOf(TPatternMap) 376 - SizeOf(TPatternMap)
315 - SizeOf(TOrderMatrix) 377 - SizeOf(TOrderMatrix)
316 - SizeOf(TRoutineBank); 378 - SizeOf(TRoutineBank);
@@ -345,6 +407,7 @@ var
345 SV2: TSongV2; 407 SV2: TSongV2;
346 SV3: TSongV3; 408 SV3: TSongV3;
347 SV4: TSongV4; 409 SV4: TSongV4;
410 SV5: TSongV5;
348 begin 411 begin
349 S.Read(Version, SizeOf(Integer)); 412 S.Read(Version, SizeOf(Integer));
350 S.Seek(0, soBeginning); 413 S.Seek(0, soBeginning);
@@ -366,7 +429,11 @@ begin
366 ASong := UpgradeSong(SV4); 429 ASong := UpgradeSong(SV4);
367 end; 430 end;
368 5: begin 431 5: begin
369 ReadSongFromStreamV5(S, ASong); 432 ReadSongFromStreamV5(S, SV5);
433 ASong := UpgradeSong(SV5);
434 end;
435 6: begin
436 ReadSongFromStreamV6(S, ASong);
370 end; 437 end;
371 end; 438 end;
372 end; 439 end;
Modifiedtracker.lfm +157−113
@@ -1,12 +1,12 @@
1 object frmTracker: TfrmTracker 1 object frmTracker: TfrmTracker
2 Left = 814 2 Left = 1656
3 Height = 654 3 Height = 902
4 Top = 197 4 Top = 134
5 Width = 1232 5 Width = 1458
6 AllowDropFiles = True 6 AllowDropFiles = True
7 Caption = 'hUGETracker' 7 Caption = 'hUGETracker'
8 ClientHeight = 634 8 ClientHeight = 882
9 ClientWidth = 1232 9 ClientWidth = 1458
10 KeyPreview = True 10 KeyPreview = True
11 Menu = MainMenu1 11 Menu = MainMenu1
12 OnCloseQuery = FormCloseQuery 12 OnCloseQuery = FormCloseQuery
@@ -20,7 +20,7 @@ object frmTracker: TfrmTracker
20 LCLVersion = '2.0.12.0' 20 LCLVersion = '2.0.12.0'
21 object TreeView1: TTreeView 21 object TreeView1: TTreeView
22 Left = 0 22 Left = 0
23 Height = 522 23 Height = 770
24 Top = 89 24 Top = 89
25 Width = 193 25 Width = 193
26 Align = alLeft 26 Align = alLeft
@@ -41,35 +41,35 @@ object frmTracker: TfrmTracker
41 end 41 end
42 object Splitter1: TSplitter 42 object Splitter1: TSplitter
43 Left = 193 43 Left = 193
44 Height = 522 44 Height = 770
45 Top = 89 45 Top = 89
46 Width = 5 46 Width = 5
47 end 47 end
48 object Panel1: TPanel 48 object Panel1: TPanel
49 Left = 198 49 Left = 198
50 Height = 522 50 Height = 770
51 Top = 89 51 Top = 89
52 Width = 1034 52 Width = 1260
53 Align = alClient 53 Align = alClient
54 BevelOuter = bvNone 54 BevelOuter = bvNone
55 ClientHeight = 522 55 ClientHeight = 770
56 ClientWidth = 1034 56 ClientWidth = 1260
57 ParentFont = False 57 ParentFont = False
58 TabOrder = 2 58 TabOrder = 2
59 object PageControl1: TPageControl 59 object PageControl1: TPageControl
60 Left = 0 60 Left = 0
61 Height = 522 61 Height = 770
62 Top = 0 62 Top = 0
63 Width = 1034 63 Width = 1260
64 ActivePage = InstrumentTabSheet 64 ActivePage = PatternTabSheet
65 Align = alClient 65 Align = alClient
66 ParentFont = False 66 ParentFont = False
67 TabIndex = 2 67 TabIndex = 1
68 TabOrder = 0 68 TabOrder = 0
69 object GeneralTabSheet: TTabSheet 69 object GeneralTabSheet: TTabSheet
70 Caption = 'General' 70 Caption = 'General'
71 ClientHeight = 871 71 ClientHeight = 742
72 ClientWidth = 1801 72 ClientWidth = 1252
73 ParentFont = False 73 ParentFont = False
74 object SongInformationGroupbox: TGroupBox 74 object SongInformationGroupbox: TGroupBox
75 Left = 8 75 Left = 8
@@ -83,25 +83,25 @@ object frmTracker: TfrmTracker
83 TabOrder = 0 83 TabOrder = 0
84 object Label15: TLabel 84 object Label15: TLabel
85 Left = 8 85 Left = 8
86 Height = 30 86 Height = 15
87 Top = 16 87 Top = 16
88 Width = 47 88 Width = 27
89 Caption = 'Song' 89 Caption = 'Song'
90 ParentColor = False 90 ParentColor = False
91 ParentFont = False 91 ParentFont = False
92 end 92 end
93 object Label16: TLabel 93 object Label16: TLabel
94 Left = 7 94 Left = 7
95 Height = 30 95 Height = 15
96 Top = 48 96 Top = 48
97 Width = 49 97 Width = 28
98 Caption = 'Artist' 98 Caption = 'Artist'
99 ParentColor = False 99 ParentColor = False
100 ParentFont = False 100 ParentFont = False
101 end 101 end
102 object SongEdit: TEdit 102 object SongEdit: TEdit
103 Left = 56 103 Left = 56
104 Height = 38 104 Height = 23
105 Hint = 'The name of your composition' 105 Hint = 'The name of your composition'
106 Top = 8 106 Top = 8
107 Width = 216 107 Width = 216
@@ -112,7 +112,7 @@ object frmTracker: TfrmTracker
112 end 112 end
113 object ArtistEdit: TEdit 113 object ArtistEdit: TEdit
114 Left = 56 114 Left = 56
115 Height = 38 115 Height = 23
116 Hint = 'Your name or handle' 116 Hint = 'Your name or handle'
117 Top = 40 117 Top = 40
118 Width = 216 118 Width = 216
@@ -123,16 +123,16 @@ object frmTracker: TfrmTracker
123 end 123 end
124 object Label21: TLabel 124 object Label21: TLabel
125 Left = 8 125 Left = 8
126 Height = 30 126 Height = 15
127 Top = 78 127 Top = 78
128 Width = 197 128 Width = 114
129 Caption = 'Tempo (ticks per row)' 129 Caption = 'Tempo (ticks per row)'
130 ParentColor = False 130 ParentColor = False
131 ParentFont = False 131 ParentFont = False
132 end 132 end
133 object TicksPerRowSpinEdit: TSpinEdit 133 object TicksPerRowSpinEdit: TSpinEdit
134 Left = 133 134 Left = 133
135 Height = 38 135 Height = 23
136 Hint = 'How many ticks should happen before the row changes. Higher means slower' 136 Hint = 'How many ticks should happen before the row changes. Higher means slower'
137 Top = 73 137 Top = 73
138 Width = 50 138 Width = 50
@@ -147,17 +147,17 @@ object frmTracker: TfrmTracker
147 end 147 end
148 object PatternTabSheet: TTabSheet 148 object PatternTabSheet: TTabSheet
149 Caption = 'Patterns' 149 Caption = 'Patterns'
150 ClientHeight = 871 150 ClientHeight = 742
151 ClientWidth = 1801 151 ClientWidth = 1252
152 ParentFont = False 152 ParentFont = False
153 object Panel3: TPanel 153 object Panel3: TPanel
154 Left = 392 154 Left = 224
155 Height = 871 155 Height = 742
156 Top = 0 156 Top = 0
157 Width = 1409 157 Width = 1028
158 Align = alClient 158 Align = alClient
159 ClientHeight = 871 159 ClientHeight = 742
160 ClientWidth = 1409 160 ClientWidth = 1028
161 ParentFont = False 161 ParentFont = False
162 TabOrder = 0 162 TabOrder = 0
163 object HeaderControl1: THeaderControl 163 object HeaderControl1: THeaderControl
@@ -165,7 +165,7 @@ object frmTracker: TfrmTracker
165 Height = 30 165 Height = 30
166 Hint = 'Left click to mute, right click to solo' 166 Hint = 'Left click to mute, right click to solo'
167 Top = 1 167 Top = 1
168 Width = 1407 168 Width = 1026
169 DragReorder = False 169 DragReorder = False
170 Images = ImageList2 170 Images = ImageList2
171 Sections = < 171 Sections = <
@@ -210,27 +210,28 @@ object frmTracker: TfrmTracker
210 end 210 end
211 object ScrollBox1: TScrollBox 211 object ScrollBox1: TScrollBox
212 Left = 1 212 Left = 1
213 Height = 817 213 Height = 710
214 Top = 53 214 Top = 31
215 Width = 1407 215 Width = 1026
216 HorzScrollBar.Increment = 5 216 HorzScrollBar.Increment = 3
217 HorzScrollBar.Page = 56 217 HorzScrollBar.Page = 32
218 HorzScrollBar.Smooth = True 218 HorzScrollBar.Smooth = True
219 HorzScrollBar.Tracking = True 219 HorzScrollBar.Tracking = True
220 VertScrollBar.Page = 88 220 VertScrollBar.Increment = 5
221 VertScrollBar.Page = 50
221 VertScrollBar.Smooth = True 222 VertScrollBar.Smooth = True
222 VertScrollBar.Tracking = True 223 VertScrollBar.Tracking = True
223 Align = alClient 224 Align = alClient
224 BorderStyle = bsNone 225 BorderStyle = bsNone
225 ClientHeight = 817 226 ClientHeight = 710
226 ClientWidth = 1407 227 ClientWidth = 1026
227 ParentFont = False 228 ParentFont = False
228 TabOrder = 1 229 TabOrder = 1
229 OnMouseWheelDown = ScrollBox1MouseWheelDown 230 OnMouseWheelDown = ScrollBox1MouseWheelDown
230 OnMouseWheelUp = ScrollBox1MouseWheelUp 231 OnMouseWheelUp = ScrollBox1MouseWheelUp
231 object RowNumberStringGrid: TStringGrid 232 object RowNumberStringGrid: TStringGrid
232 Left = 0 233 Left = 0
233 Height = 817 234 Height = 710
234 Top = 0 235 Top = 0
235 Width = 32 236 Width = 32
236 Align = alLeft 237 Align = alLeft
@@ -247,7 +248,7 @@ object frmTracker: TfrmTracker
247 end 248 end
248 object OrderEditStringGrid: TStringGrid 249 object OrderEditStringGrid: TStringGrid
249 Left = 0 250 Left = 0
250 Height = 871 251 Height = 742
251 Top = 0 252 Top = 0
252 Width = 224 253 Width = 224
253 Align = alLeft 254 Align = alLeft
@@ -312,30 +313,14 @@ object frmTracker: TfrmTracker
312 end 313 end
313 object InstrumentTabSheet: TTabSheet 314 object InstrumentTabSheet: TTabSheet
314 Caption = 'Instruments' 315 Caption = 'Instruments'
315 ClientHeight = 494 316 ClientHeight = 742
316 ClientWidth = 1026 317 ClientWidth = 1252
317 ParentFont = False 318 ParentFont = False
318 object PaintBox1: TPaintBox
319 AnchorSideTop.Control = FlowPanel1
320 AnchorSideTop.Side = asrBottom
321 AnchorSideBottom.Side = asrBottom
322 Left = 0
323 Height = 0
324 Hint = 'Preview of how the resulting waveform will look with envelope applied'
325 Top = 494
326 Width = 1026
327 Align = alClient
328 Color = clBlack
329 ParentColor = False
330 ParentFont = False
331 Visible = False
332 OnPaint = PaintBox1Paint
333 end
334 object FlowPanel1: TFlowPanel 319 object FlowPanel1: TFlowPanel
335 Left = 0 320 Left = 0
336 Height = 675 321 Height = 574
337 Top = 0 322 Top = 0
338 Width = 1026 323 Width = 1252
339 Align = alTop 324 Align = alTop
340 AutoSize = True 325 AutoSize = True
341 BevelOuter = bvNone 326 BevelOuter = bvNone
@@ -364,6 +349,11 @@ object frmTracker: TfrmTracker
364 Control = NoiseGroupBox 349 Control = NoiseGroupBox
365 WrapAfter = waAuto 350 WrapAfter = waAuto
366 Index = 4 351 Index = 4
352 end
353 item
354 Control = TableGroupBox
355 WrapAfter = waAuto
356 Index = 5
367 end> 357 end>
368 FlowLayout = tlTop 358 FlowLayout = tlTop
369 FlowStyle = fsLeftRightTopBottom 359 FlowStyle = fsLeftRightTopBottom
@@ -371,7 +361,7 @@ object frmTracker: TfrmTracker
371 TabOrder = 0 361 TabOrder = 0
372 object InstrumentGroupBox: TGroupBox 362 object InstrumentGroupBox: TGroupBox
373 Left = 7 363 Left = 7
374 Height = 241 364 Height = 273
375 Top = 7 365 Top = 7
376 Width = 280 366 Width = 280
377 Anchors = [] 367 Anchors = []
@@ -380,7 +370,7 @@ object frmTracker: TfrmTracker
380 BorderSpacing.Right = 7 370 BorderSpacing.Right = 7
381 BorderSpacing.Bottom = 7 371 BorderSpacing.Bottom = 7
382 Caption = 'Instrument' 372 Caption = 'Instrument'
383 ClientHeight = 221 373 ClientHeight = 253
384 ClientWidth = 276 374 ClientWidth = 276
385 ParentFont = False 375 ParentFont = False
386 TabOrder = 0 376 TabOrder = 0
@@ -437,11 +427,11 @@ object frmTracker: TfrmTracker
437 ParentFont = False 427 ParentFont = False
438 end 428 end
439 object InstrumentTypeCombobox: TComboBox 429 object InstrumentTypeCombobox: TComboBox
440 Left = 76 430 Left = 80
441 Height = 23 431 Height = 23
442 Hint = 'What type of channel this instrument will be played on' 432 Hint = 'What type of channel this instrument will be played on'
443 Top = 8 433 Top = 8
444 Width = 189 434 Width = 185
445 ItemHeight = 15 435 ItemHeight = 15
446 ItemIndex = 0 436 ItemIndex = 0
447 Items.Strings = ( 437 Items.Strings = (
@@ -469,7 +459,7 @@ object frmTracker: TfrmTracker
469 object InstrumentImportButton: TButton 459 object InstrumentImportButton: TButton
470 Left = 12 460 Left = 12
471 Height = 25 461 Height = 25
472 Top = 184 462 Top = 216
473 Width = 116 463 Width = 116
474 Caption = 'Import' 464 Caption = 'Import'
475 OnClick = InstrumentImportButtonClick 465 OnClick = InstrumentImportButtonClick
@@ -479,7 +469,7 @@ object frmTracker: TfrmTracker
479 object InstrumentExportButton: TButton 469 object InstrumentExportButton: TButton
480 Left = 149 470 Left = 149
481 Height = 25 471 Height = 25
482 Top = 184 472 Top = 216
483 Width = 116 473 Width = 116
484 Caption = 'Export' 474 Caption = 'Export'
485 OnClick = InstrumentExportButtonClick 475 OnClick = InstrumentExportButtonClick
@@ -579,6 +569,14 @@ object frmTracker: TfrmTracker
579 ParentFont = False 569 ParentFont = False
580 TabOrder = 12 570 TabOrder = 12
581 end 571 end
572 object CheckBox1: TCheckBox
573 Left = 12
574 Height = 19
575 Top = 184
576 Width = 115
577 Caption = 'Enable subpattern'
578 TabOrder = 13
579 end
582 end 580 end
583 object EnvelopeGroupBox: TGroupBox 581 object EnvelopeGroupBox: TGroupBox
584 Left = 301 582 Left = 301
@@ -598,7 +596,7 @@ object frmTracker: TfrmTracker
598 object Label4: TLabel 596 object Label4: TLabel
599 Left = 8 597 Left = 8
600 Height = 15 598 Height = 15
601 Top = 9 599 Top = 16
602 Width = 46 600 Width = 46
603 Caption = 'Start vol.' 601 Caption = 'Start vol.'
604 ParentColor = False 602 ParentColor = False
@@ -607,7 +605,7 @@ object frmTracker: TfrmTracker
607 object Label5: TLabel 605 object Label5: TLabel
608 Left = 8 606 Left = 8
609 Height = 15 607 Height = 15
610 Top = 48 608 Top = 54
611 Width = 48 609 Width = 48
612 Caption = 'Direction' 610 Caption = 'Direction'
613 ParentColor = False 611 ParentColor = False
@@ -634,7 +632,7 @@ object frmTracker: TfrmTracker
634 object Label6: TLabel 632 object Label6: TLabel
635 Left = 8 633 Left = 8
636 Height = 15 634 Height = 15
637 Top = 86 635 Top = 90
638 Width = 41 636 Width = 41
639 Caption = 'Change' 637 Caption = 'Change'
640 ParentColor = False 638 ParentColor = False
@@ -685,9 +683,9 @@ object frmTracker: TfrmTracker
685 end 683 end
686 end 684 end
687 object SquareGroupBox: TGroupBox 685 object SquareGroupBox: TGroupBox
688 Left = 7 686 Left = 897
689 Height = 169 687 Height = 169
690 Top = 262 688 Top = 7
691 Width = 319 689 Width = 319
692 Anchors = [] 690 Anchors = []
693 BorderSpacing.Left = 7 691 BorderSpacing.Left = 7
@@ -766,7 +764,7 @@ object frmTracker: TfrmTracker
766 object Label9: TLabel 764 object Label9: TLabel
767 Left = 8 765 Left = 8
768 Height = 15 766 Height = 15
769 Top = 84 767 Top = 88
770 Width = 56 768 Width = 56
771 Caption = 'Sweep size' 769 Caption = 'Sweep size'
772 ParentColor = False 770 ParentColor = False
@@ -816,9 +814,9 @@ object frmTracker: TfrmTracker
816 end 814 end
817 end 815 end
818 object WaveGroupBox: TGroupBox 816 object WaveGroupBox: TGroupBox
819 Left = 340 817 Left = 7
820 Height = 169 818 Height = 169
821 Top = 262 819 Top = 294
822 Width = 297 820 Width = 297
823 Anchors = [] 821 Anchors = []
824 BorderSpacing.Left = 7 822 BorderSpacing.Left = 7
@@ -925,9 +923,9 @@ object frmTracker: TfrmTracker
925 end 923 end
926 end 924 end
927 object NoiseGroupBox: TGroupBox 925 object NoiseGroupBox: TGroupBox
928 Left = 7 926 Left = 318
929 Height = 223 927 Height = 223
930 Top = 445 928 Top = 294
931 Width = 397 929 Width = 397
932 Anchors = [] 930 Anchors = []
933 BorderSpacing.Left = 7 931 BorderSpacing.Left = 7
@@ -975,20 +973,66 @@ object frmTracker: TfrmTracker
975 end 973 end
976 end 974 end
977 end 975 end
976 object TableGroupBox: TGroupBox
977 Left = 729
978 Height = 273
979 Top = 294
980 Width = 342
981 Anchors = []
982 BorderSpacing.Left = 7
983 BorderSpacing.Top = 7
984 BorderSpacing.Right = 7
985 BorderSpacing.Bottom = 7
986 Caption = 'Subpattern'
987 ClientHeight = 253
988 ClientWidth = 338
989 TabOrder = 5
990 object ScrollBox2: TScrollBox
991 Left = 0
992 Height = 253
993 Top = 0
994 Width = 338
995 HorzScrollBar.Page = 32
996 HorzScrollBar.Smooth = True
997 HorzScrollBar.Tracking = True
998 VertScrollBar.Page = 50
999 VertScrollBar.Smooth = True
1000 VertScrollBar.Tracking = True
1001 Align = alClient
1002 ClientHeight = 249
1003 ClientWidth = 334
1004 TabOrder = 0
1005 object RowNumberStringGrid1: TStringGrid
1006 Left = 0
1007 Height = 249
1008 Top = 0
1009 Width = 32
1010 Align = alLeft
1011 BorderStyle = bsNone
1012 ColCount = 1
1013 DefaultColWidth = 32
1014 Enabled = False
1015 ParentFont = False
1016 RowCount = 64
1017 ScrollBars = ssNone
1018 TabOrder = 0
1019 end
1020 end
1021 end
978 end 1022 end
979 end 1023 end
980 object WavesTabSheet: TTabSheet 1024 object WavesTabSheet: TTabSheet
981 Caption = 'Waves' 1025 Caption = 'Waves'
982 ClientHeight = 493 1026 ClientHeight = 685
983 ClientWidth = 1026 1027 ClientWidth = 1116
984 ParentFont = False 1028 ParentFont = False
985 object WaveEditPaintBox: TPaintBox 1029 object WaveEditPaintBox: TPaintBox
986 AnchorSideTop.Control = WaveEditGroupBox 1030 AnchorSideTop.Control = WaveEditGroupBox
987 AnchorSideTop.Side = asrBottom 1031 AnchorSideTop.Side = asrBottom
988 Left = 0 1032 Left = 0
989 Height = 333 1033 Height = 525
990 Top = 160 1034 Top = 160
991 Width = 1026 1035 Width = 1116
992 Align = alBottom 1036 Align = alBottom
993 Anchors = [akTop, akLeft, akRight, akBottom] 1037 Anchors = [akTop, akLeft, akRight, akBottom]
994 BorderSpacing.Top = 13 1038 BorderSpacing.Top = 13
@@ -1658,11 +1702,11 @@ object frmTracker: TfrmTracker
1658 Left = 0 1702 Left = 0
1659 Height = 64 1703 Height = 64
1660 Top = 25 1704 Top = 25
1661 Width = 1232 1705 Width = 1458
1662 Align = alTop 1706 Align = alTop
1663 BevelOuter = bvNone 1707 BevelOuter = bvNone
1664 ClientHeight = 64 1708 ClientHeight = 64
1665 ClientWidth = 1232 1709 ClientWidth = 1458
1666 ParentFont = False 1710 ParentFont = False
1667 TabOrder = 3 1711 TabOrder = 3
1668 object LEDMeter1: TLEDMeter 1712 object LEDMeter1: TLEDMeter
@@ -1670,7 +1714,7 @@ object frmTracker: TfrmTracker
1670 Left = 0 1714 Left = 0
1671 Height = 32 1715 Height = 32
1672 Top = 32 1716 Top = 32
1673 Width = 444 1717 Width = 670
1674 Anchors = [akTop, akLeft, akRight] 1718 Anchors = [akTop, akLeft, akRight]
1675 BevelStyle = bvLowered 1719 BevelStyle = bvLowered
1676 Colors.Border = 2168839 1720 Colors.Border = 2168839
@@ -1693,7 +1737,7 @@ object frmTracker: TfrmTracker
1693 Left = 0 1737 Left = 0
1694 Height = 32 1738 Height = 32
1695 Top = 0 1739 Top = 0
1696 Width = 444 1740 Width = 670
1697 Anchors = [akTop, akLeft, akRight] 1741 Anchors = [akTop, akLeft, akRight]
1698 BevelStyle = bvLowered 1742 BevelStyle = bvLowered
1699 Colors.Border = 2168839 1743 Colors.Border = 2168839
@@ -1712,7 +1756,7 @@ object frmTracker: TfrmTracker
1712 Section3Value = 48 1756 Section3Value = 48
1713 end 1757 end
1714 object Duty1Visualizer: TPaintBox 1758 object Duty1Visualizer: TPaintBox
1715 Left = 444 1759 Left = 670
1716 Height = 64 1760 Height = 64
1717 Top = 0 1761 Top = 0
1718 Width = 197 1762 Width = 197
@@ -1722,7 +1766,7 @@ object frmTracker: TfrmTracker
1722 OnPaint = Duty1VisualizerPaint 1766 OnPaint = Duty1VisualizerPaint
1723 end 1767 end
1724 object Duty2Visualizer: TPaintBox 1768 object Duty2Visualizer: TPaintBox
1725 Left = 641 1769 Left = 867
1726 Height = 64 1770 Height = 64
1727 Top = 0 1771 Top = 0
1728 Width = 197 1772 Width = 197
@@ -1732,7 +1776,7 @@ object frmTracker: TfrmTracker
1732 OnPaint = Duty2VisualizerPaint 1776 OnPaint = Duty2VisualizerPaint
1733 end 1777 end
1734 object WaveVisualizer: TPaintBox 1778 object WaveVisualizer: TPaintBox
1735 Left = 838 1779 Left = 1064
1736 Height = 64 1780 Height = 64
1737 Top = 0 1781 Top = 0
1738 Width = 197 1782 Width = 197
@@ -1742,7 +1786,7 @@ object frmTracker: TfrmTracker
1742 OnPaint = WaveVisualizerPaint 1786 OnPaint = WaveVisualizerPaint
1743 end 1787 end
1744 object NoiseVisualizer: TPaintBox 1788 object NoiseVisualizer: TPaintBox
1745 Left = 1035 1789 Left = 1261
1746 Height = 64 1790 Height = 64
1747 Top = 0 1791 Top = 0
1748 Width = 197 1792 Width = 197
@@ -1755,8 +1799,8 @@ object frmTracker: TfrmTracker
1755 object StatusBar1: TStatusBar 1799 object StatusBar1: TStatusBar
1756 Left = 0 1800 Left = 0
1757 Height = 23 1801 Height = 23
1758 Top = 611 1802 Top = 859
1759 Width = 1232 1803 Width = 1458
1760 AutoHint = True 1804 AutoHint = True
1761 Panels = < 1805 Panels = <
1762 item 1806 item
@@ -1777,7 +1821,7 @@ object frmTracker: TfrmTracker
1777 Left = 0 1821 Left = 0
1778 Height = 25 1822 Height = 25
1779 Top = 0 1823 Top = 0
1780 Width = 1232 1824 Width = 1458
1781 AutoSize = True 1825 AutoSize = True
1782 Caption = 'ToolBar1' 1826 Caption = 'ToolBar1'
1783 EdgeBorders = [ebBottom] 1827 EdgeBorders = [ebBottom]
@@ -1794,7 +1838,7 @@ object frmTracker: TfrmTracker
1794 ParentShowHint = False 1838 ParentShowHint = False
1795 end 1839 end
1796 object PanicToolButton: TToolButton 1840 object PanicToolButton: TToolButton
1797 Left = 551 1841 Left = 557
1798 Hint = 'Stops all sound output' 1842 Hint = 'Stops all sound output'
1799 Top = 0 1843 Top = 0
1800 AutoSize = True 1844 AutoSize = True
@@ -1805,17 +1849,17 @@ object frmTracker: TfrmTracker
1805 ShowHint = True 1849 ShowHint = True
1806 end 1850 end
1807 object ToolButton2: TToolButton 1851 object ToolButton2: TToolButton
1808 Left = 145 1852 Left = 147
1809 Top = 0 1853 Top = 0
1810 Action = PlayCursorAction 1854 Action = PlayCursorAction
1811 end 1855 end
1812 object ToolButton4: TToolButton 1856 object ToolButton4: TToolButton
1813 Left = 219 1857 Left = 221
1814 Top = 0 1858 Top = 0
1815 Action = StopAction 1859 Action = StopAction
1816 end 1860 end
1817 object ExportGBButton: TToolButton 1861 object ExportGBButton: TToolButton
1818 Left = 287 1862 Left = 291
1819 Hint = 'Export the song as a standalone ROM' 1863 Hint = 'Export the song as a standalone ROM'
1820 Top = 0 1864 Top = 0
1821 AutoSize = True 1865 AutoSize = True
@@ -1831,21 +1875,21 @@ object frmTracker: TfrmTracker
1831 Style = tbsDivider 1875 Style = tbsDivider
1832 end 1876 end
1833 object ToolButton6: TToolButton 1877 object ToolButton6: TToolButton
1834 Left = 284 1878 Left = 286
1835 Height = 22 1879 Height = 22
1836 Top = 0 1880 Top = 0
1837 Caption = 'ToolButton6' 1881 Caption = 'ToolButton6'
1838 Style = tbsDivider 1882 Style = tbsDivider
1839 end 1883 end
1840 object ToolButton7: TToolButton 1884 object ToolButton7: TToolButton
1841 Left = 1088 1885 Left = 1097
1842 Height = 22 1886 Height = 22
1843 Top = 0 1887 Top = 0
1844 Caption = 'ToolButton7' 1888 Caption = 'ToolButton7'
1845 Style = tbsSeparator 1889 Style = tbsSeparator
1846 end 1890 end
1847 object OctaveSpinEdit: TSpinEdit 1891 object OctaveSpinEdit: TSpinEdit
1848 Left = 654 1892 Left = 663
1849 Height = 23 1893 Height = 23
1850 Hint = 'The octave offset for entering new notes' 1894 Hint = 'The octave offset for entering new notes'
1851 Top = 0 1895 Top = 0
@@ -1856,14 +1900,14 @@ object frmTracker: TfrmTracker
1856 TabOrder = 0 1900 TabOrder = 0
1857 end 1901 end
1858 object ToolButton9: TToolButton 1902 object ToolButton9: TToolButton
1859 Left = 606 1903 Left = 612
1860 Height = 22 1904 Height = 22
1861 Top = 0 1905 Top = 0
1862 Caption = 'ToolButton9' 1906 Caption = 'ToolButton9'
1863 Style = tbsSeparator 1907 Style = tbsSeparator
1864 end 1908 end
1865 object Label22: TLabel 1909 object Label22: TLabel
1866 Left = 611 1910 Left = 620
1867 Height = 22 1911 Height = 22
1868 Top = 0 1912 Top = 0
1869 Width = 43 1913 Width = 43
@@ -1874,7 +1918,7 @@ object frmTracker: TfrmTracker
1874 ParentFont = False 1918 ParentFont = False
1875 end 1919 end
1876 object Label23: TLabel 1920 object Label23: TLabel
1877 Left = 719 1921 Left = 728
1878 Height = 22 1922 Height = 22
1879 Top = 0 1923 Top = 0
1880 Width = 70 1924 Width = 70
@@ -1885,7 +1929,7 @@ object frmTracker: TfrmTracker
1885 ParentFont = False 1929 ParentFont = False
1886 end 1930 end
1887 object InstrumentComboBox: TComboBox 1931 object InstrumentComboBox: TComboBox
1888 Left = 789 1932 Left = 798
1889 Height = 23 1933 Height = 23
1890 Hint = 'The selected instrument for new notes' 1934 Hint = 'The selected instrument for new notes'
1891 Top = 0 1935 Top = 0
@@ -1903,7 +1947,7 @@ object frmTracker: TfrmTracker
1903 Text = '(no instrument)' 1947 Text = '(no instrument)'
1904 end 1948 end
1905 object Label24: TLabel 1949 object Label24: TLabel
1906 Left = 1003 1950 Left = 1012
1907 Height = 22 1951 Height = 22
1908 Top = 0 1952 Top = 0
1909 Width = 35 1953 Width = 35
@@ -1914,7 +1958,7 @@ object frmTracker: TfrmTracker
1914 ParentFont = False 1958 ParentFont = False
1915 end 1959 end
1916 object StepSpinEdit: TSpinEdit 1960 object StepSpinEdit: TSpinEdit
1917 Left = 1038 1961 Left = 1047
1918 Height = 23 1962 Height = 23
1919 Hint = 'How many rows to step down after entering a new note' 1963 Hint = 'How many rows to step down after entering a new note'
1920 Top = 0 1964 Top = 0
@@ -1925,12 +1969,12 @@ object frmTracker: TfrmTracker
1925 TabOrder = 2 1969 TabOrder = 2
1926 end 1970 end
1927 object ToolButton3: TToolButton 1971 object ToolButton3: TToolButton
1928 Left = 82 1972 Left = 84
1929 Top = 0 1973 Top = 0
1930 Action = PlayStartAction 1974 Action = PlayStartAction
1931 end 1975 end
1932 object ExportGBSButton: TToolButton 1976 object ExportGBSButton: TToolButton
1933 Left = 368 1977 Left = 372
1934 Hint = 'Export the song as a GBS soundtrack' 1978 Hint = 'Export the song as a GBS soundtrack'
1935 Top = 0 1979 Top = 0
1936 Caption = 'Export .GBS' 1980 Caption = 'Export .GBS'
@@ -1938,14 +1982,14 @@ object frmTracker: TfrmTracker
1938 OnClick = ExportGBSButtonClick 1982 OnClick = ExportGBSButtonClick
1939 end 1983 end
1940 object ToolButton5: TToolButton 1984 object ToolButton5: TToolButton
1941 Left = 548 1985 Left = 552
1942 Height = 22 1986 Height = 22
1943 Top = 0 1987 Top = 0
1944 Caption = 'ToolButton5' 1988 Caption = 'ToolButton5'
1945 Style = tbsDivider 1989 Style = tbsDivider
1946 end 1990 end
1947 object ToolButton10: TToolButton 1991 object ToolButton10: TToolButton
1948 Left = 455 1992 Left = 459
1949 Hint = 'Export the song as WAV or MP3' 1993 Hint = 'Export the song as WAV or MP3'
1950 Top = 0 1994 Top = 0
1951 Caption = 'Render Song' 1995 Caption = 'Render Song'
Modifiedtracker.pas +16−23
@@ -10,7 +10,7 @@ uses
10 sound, vars, machine, about_hugetracker, TrackerGrid, lclintf, lmessages, 10 sound, vars, machine, about_hugetracker, TrackerGrid, lclintf, lmessages,
11 Buttons, Grids, DBCtrls, HugeDatatypes, LCLType, Clipbrd, RackCtls, Codegen, 11 Buttons, Grids, DBCtrls, HugeDatatypes, LCLType, Clipbrd, RackCtls, Codegen,
12 SymParser, options, bgrabitmap, effecteditor, RenderToWave, 12 SymParser, options, bgrabitmap, effecteditor, RenderToWave,
13 modimport, beepboximport, mainloop, strutils, Types, Keymap, hUGESettings, 13 modimport, mainloop, strutils, Types, Keymap, hUGESettings,
14 dmfimport; 14 dmfimport;
15 15
16 // TODO: Move to config file? 16 // TODO: Move to config file?
@@ -26,7 +26,11 @@ type
26 { TfrmTracker } 26 { TfrmTracker }
27 27
28 TfrmTracker = class(TForm) 28 TfrmTracker = class(TForm)
29 CheckBox1: TCheckBox;
29 DecreaseOctaveAction: TAction; 30 DecreaseOctaveAction: TAction;
31 RowNumberStringGrid1: TStringGrid;
32 ScrollBox2: TScrollBox;
33 TableGroupBox: TGroupBox;
30 IncreaseOctaveAction: TAction; 34 IncreaseOctaveAction: TAction;
31 IncrementCurrentInstrumentAction: TAction; 35 IncrementCurrentInstrumentAction: TAction;
32 DecrementCurrentInstrumentAction: TAction; 36 DecrementCurrentInstrumentAction: TAction;
@@ -250,7 +254,6 @@ type
250 SampleSongsMenuItem: TMenuItem; 254 SampleSongsMenuItem: TMenuItem;
251 MenuItem5: TMenuItem; 255 MenuItem5: TMenuItem;
252 PageControl1: TPageControl; 256 PageControl1: TPageControl;
253 PaintBox1: TPaintBox;
254 WavePaintbox: TPaintBox; 257 WavePaintbox: TPaintBox;
255 Panel1: TPanel; 258 Panel1: TPanel;
256 Panel2: TPanel; 259 Panel2: TPanel;
@@ -265,6 +268,7 @@ type
265 StatusBar1: TStatusBar; 268 StatusBar1: TStatusBar;
266 TreeView1: TTreeView; 269 TreeView1: TTreeView;
267 TrackerGrid: TTrackerGrid; 270 TrackerGrid: TTrackerGrid;
271 TableGrid: TTableGrid;
268 procedure TestOctaveButtonClick(Sender: TObject); 272 procedure TestOctaveButtonClick(Sender: TObject);
269 procedure DebugButtonClick(Sender: TObject); 273 procedure DebugButtonClick(Sender: TObject);
270 procedure DecreaseOctaveActionExecute(Sender: TObject); 274 procedure DecreaseOctaveActionExecute(Sender: TObject);
@@ -413,7 +417,6 @@ type
413 procedure WaveEditPaintBoxPaint(Sender: TObject); 417 procedure WaveEditPaintBoxPaint(Sender: TObject);
414 procedure InstrumentTypeComboboxChange(Sender: TObject); 418 procedure InstrumentTypeComboboxChange(Sender: TObject);
415 procedure LengthEnabledCheckboxChange(Sender: TObject); 419 procedure LengthEnabledCheckboxChange(Sender: TObject);
416 procedure PaintBox1Paint(Sender: TObject);
417 procedure SevenBitCounterCheckboxChange(Sender: TObject); 420 procedure SevenBitCounterCheckboxChange(Sender: TObject);
418 procedure SongEditChange(Sender: TObject); 421 procedure SongEditChange(Sender: TObject);
419 procedure StartVolSpinnerChange(Sender: TObject); 422 procedure StartVolSpinnerChange(Sender: TObject);
@@ -914,6 +917,7 @@ begin
914 OrderNum 917 OrderNum
915 ); 918 );
916 TrackerGrid.LoadPattern(I, OrderNum); 919 TrackerGrid.LoadPattern(I, OrderNum);
920 TableGrid.LoadPattern(I, OrderNum);
917 end; 921 end;
918 922
919 CopyOrderGridToOrderMatrix; 923 CopyOrderGridToOrderMatrix;
@@ -1034,7 +1038,7 @@ begin
1034 if RenderPreviewROM then begin 1038 if RenderPreviewROM then begin
1035 LockPlayback; 1039 LockPlayback;
1036 1040
1037 // Load the new symbol table 1041 // Load the new symbol TableGroupBox
1038 ParseSymFile('render/preview.sym'); 1042 ParseSymFile('render/preview.sym');
1039 1043
1040 // Start emulation on the rendered preview binary 1044 // Start emulation on the rendered preview binary
@@ -1126,6 +1130,12 @@ begin
1126 HeaderControl1.Sections.Items[I].Width := TrackerGrid.ColumnWidth; 1130 HeaderControl1.Sections.Items[I].Width := TrackerGrid.ColumnWidth;
1127 1131
1128 TrackerGrid.PopupMenu := TrackerGridPopup; 1132 TrackerGrid.PopupMenu := TrackerGridPopup;
1133
1134 if Assigned(TableGrid) then TableGrid.Free;
1135 TableGrid := TTableGrid.Create(Self, ScrollBox2, Song.Patterns);
1136 TableGrid.Left := RowNumberStringGrid1.Left + RowNumberStringGrid1.Width;
1137 TableGrid.FontSize := TrackerSettings.PatternEditorFontSize;
1138 RowNumberStringGrid1.DefaultRowHeight := TrackerGrid.RowHeight;
1129 end; 1139 end;
1130 1140
1131 procedure TfrmTracker.RecreateRowNumbers; 1141 procedure TfrmTracker.RecreateRowNumbers;
@@ -1291,15 +1301,6 @@ begin
1291 Application.Terminate; 1301 Application.Terminate;
1292 end; 1302 end;
1293 1303
1294 procedure TfrmTracker.PaintBox1Paint(Sender: TObject);
1295 begin
1296 PaintBox1.Canvas.Brush.Color := clBlack;
1297 PaintBox1.Canvas.Pen.Color := clBlack;
1298 PaintBox1.Canvas.Clear;
1299 if WaveformCombobox.ItemIndex > -1 then
1300 DrawWaveform(PaintBox1, Song.Waves[WaveformCombobox.ItemIndex]);
1301 end;
1302
1303 procedure TfrmTracker.SevenBitCounterCheckboxChange(Sender: TObject); 1304 procedure TfrmTracker.SevenBitCounterCheckboxChange(Sender: TObject);
1304 begin 1305 begin
1305 if SevenBitCounterCheckbox.Checked then 1306 if SevenBitCounterCheckbox.Checked then
@@ -1422,7 +1423,7 @@ begin
1422 LoadInstrument(itSquare, 1); 1423 LoadInstrument(itSquare, 1);
1423 LoadWave(0); 1424 LoadWave(0);
1424 1425
1425 // Initialize order table (InitializeSong creates the default order table) 1426 // Initialize order table (InitializeSong creates the default order TableGroupBox)
1426 CopyOrderMatrixToOrderGrid; 1427 CopyOrderMatrixToOrderGrid;
1427 1428
1428 // Manually resize the fixed column in the order editor 1429 // Manually resize the fixed column in the order editor
@@ -1993,15 +1994,7 @@ procedure TfrmTracker.DebugButtonClick(Sender: TObject);
1993 var 1994 var
1994 S: TStream; 1995 S: TStream;
1995 begin 1996 begin
1996 S := TFileStream.Create('C:/test/bbs.json', fmOpenRead); 1997 TableGrid.Invalidate;
1997 try
1998 DestroySong(Song);
1999 Song := LoadSongFromBeepBoxJsonStream(S);
2000 finally
2001 S.Free;
2002 end;
2003
2004 UpdateUIAfterLoad('Yeah!');
2005 end; 1998 end;
2006 1999
2007 procedure TfrmTracker.DecreaseOctaveActionExecute(Sender: TObject); 2000 procedure TfrmTracker.DecreaseOctaveActionExecute(Sender: TObject);
Modifiedtrackergrid.pas +62−1
@@ -81,7 +81,7 @@ type
81 procedure InputEffectParams(Key: Word); 81 procedure InputEffectParams(Key: Word);
82 82
83 procedure RenderRow(Row: Integer); 83 procedure RenderRow(Row: Integer);
84 procedure RenderCell(const Cell: TCell); 84 procedure RenderCell(const Cell: TCell); virtual;
85 85
86 procedure SetHighlightedRow(Row: Integer); 86 procedure SetHighlightedRow(Row: Integer);
87 procedure SetSelectionGridRect(R: TRect); 87 procedure SetSelectionGridRect(R: TRect);
@@ -159,6 +159,12 @@ type
159 destructor Destroy; override; 159 destructor Destroy; override;
160 end; 160 end;
161 161
162 { TTableGrid }
163
164 TTableGrid = class(TTrackerGrid)
165 procedure RenderCell(const Cell: TCell); override;
166 end;
167
162 var 168 var
163 clNote: TColor = TColor($7F4A00); 169 clNote: TColor = TColor($7F4A00);
164 clInstrument: TColor = TColor($7F7F00); 170 clInstrument: TColor = TColor($7F7F00);
@@ -169,6 +175,8 @@ var
169 clFxPan: TColor = TColor($7F7F00); 175 clFxPan: TColor = TColor($7F7F00);
170 clFxSong: TColor = TColor($00007F); 176 clFxSong: TColor = TColor($00007F);
171 177
178 clTblJump: TColor = TColor($72004E);
179
172 clBackground: TColor = TColor($D0DBE1); 180 clBackground: TColor = TColor($D0DBE1);
173 clHighlighted: TColor = TColor($7A99A9); 181 clHighlighted: TColor = TColor($7A99A9);
174 clSelected: TColor = TColor($9EB4C0); 182 clSelected: TColor = TColor($9EB4C0);
@@ -181,6 +189,59 @@ var
181 189
182 implementation 190 implementation
183 191
192 { TTableGrid }
193
194 procedure TTableGrid.RenderCell(const Cell: TCell);
195 var
196 NoteString: ShortString;
197 begin
198 with Canvas do begin
199 if NoteMap.TryGetData(Cell.Note, NoteString) then begin
200 Font.Color := clNote;
201 TextOut(PenPos.X, PenPos.Y, NoteString);
202 end
203 else begin
204 Font.Color := clDots;
205 if Cell.Note = NO_NOTE then
206 TextOut(PenPos.X, PenPos.Y, '...')
207 else
208 TextOut(PenPos.X, PenPos.Y, '???');
209 end;
210
211 TextOut(PenPos.X, PenPos.Y, ' ');
212
213 // Instrument column empty
214 Font.Color := clDots;
215 TextOut(PenPos.X, PenPos.Y, '..');
216
217 if Cell.Volume <> 0 then begin
218 Font.Color := clTblJump;
219 TextOut(PenPos.X, PenPos.Y, 'J'+FormatFloat('00', Cell.Volume));
220 end
221 else begin
222 Font.Color := clDots;
223 TextOut(PenPos.X, PenPos.Y, '...');
224 end;
225
226 if (Cell.EffectCode <> 0) or (Cell.EffectParams.Value <> 0) then begin
227 Font.Color := GetEffectColor(Cell.EffectCode);
228 TextOut(
229 PenPos.X,
230 PenPos.Y,
231 IntToHex(Cell.EffectCode, 1)
232 + IntToHex(Cell.EffectParams.Param1, 1)
233 + IntToHex(Cell.EffectParams.Param2, 1)
234 );
235 end
236 else begin
237 Font.Color := clDots;
238 TextOut(PenPos.X, PenPos.Y, '...');
239 end;
240
241 TextOut(PenPos.X, PenPos.Y, ' ');
242 end;
243 end;
244
184 { TSelectionEnumerator } 245 { TSelectionEnumerator }
185 246
186 constructor TSelectionEnumerator.Create(Grid: TPatternGrid; Cursor, 247 constructor TSelectionEnumerator.Create(Grid: TPatternGrid; Cursor,