@@ -414,8 +414,8 @@ type |
| 414 |
procedure DrawWaveform(PB: TPaintBox; Wave: TWave); |
414 |
procedure DrawWaveform(PB: TPaintBox; Wave: TWave); |
| 415 |
procedure DrawVizualizer(PB: TPaintBox; Channel: Integer); |
415 |
procedure DrawVizualizer(PB: TPaintBox; Channel: Integer); |
| 416 |
|
416 |
|
| 417 |
procedure PreviewInstrument(Freq: Integer; Instr: Integer); overload; |
417 |
procedure PreviewInstrument(Freq: Integer; Instr: Integer; SquareOnCh2: Boolean = False); overload; |
| 418 |
procedure PreviewInstrument(Freq: Integer; Instr: TInstrument); overload; |
418 |
procedure PreviewInstrument(Freq: Integer; Instr: TInstrument; SquareOnCh2: Boolean = False); overload; |
| 419 |
procedure PreviewC5; |
419 |
procedure PreviewC5; |
| 420 |
procedure Panic; |
420 |
procedure Panic; |
| 421 |
public |
421 |
public |
@@ -464,6 +464,8 @@ begin |
| 464 |
for I := Low(Song.Instruments.Noise) to High(song.Instruments.Noise) do |
464 |
for I := Low(Song.Instruments.Noise) to High(song.Instruments.Noise) do |
| 465 |
InstrumentComboBox.Items.Add('Noise '+IntToStr(I)+': '+Song.Instruments.Noise[ModInst(I)].Name); |
465 |
InstrumentComboBox.Items.Add('Noise '+IntToStr(I)+': '+Song.Instruments.Noise[ModInst(I)].Name); |
| 466 |
|
466 |
|
|
|
467 |
InstrumentComboBox.ItemIndex := 0; |
|
|
468 |
|
| 467 |
for I := Low(TInstrumentBank) to High(TInstrumentBank) do begin |
469 |
for I := Low(TInstrumentBank) to High(TInstrumentBank) do begin |
| 468 |
DutyInstrumentsNode.Items[I-1].Text := IntToStr(I)+': '+Song.Instruments.Duty[I].Name; |
470 |
DutyInstrumentsNode.Items[I-1].Text := IntToStr(I)+': '+Song.Instruments.Duty[I].Name; |
| 469 |
WaveInstrumentsNode.Items[I-1].Text := IntToStr(I)+': '+Song.Instruments.Wave[I].Name; |
471 |
WaveInstrumentsNode.Items[I-1].Text := IntToStr(I)+': '+Song.Instruments.Wave[I].Name; |
@@ -574,12 +576,14 @@ begin |
| 574 |
//PB.Canvas.Draw(0, 0, VisualizerBuffer); |
576 |
//PB.Canvas.Draw(0, 0, VisualizerBuffer); |
| 575 |
end; |
577 |
end; |
| 576 |
|
578 |
|
| 577 |
procedure TfrmTracker.PreviewInstrument(Freq: Integer; Instr: Integer); |
579 |
procedure TfrmTracker.PreviewInstrument(Freq: Integer; Instr: Integer; |
|
|
580 |
SquareOnCh2: Boolean = False); |
| 578 |
begin |
581 |
begin |
| 579 |
PreviewInstrument(Freq, Song.Instruments.All[Instr]); |
582 |
PreviewInstrument(Freq, Song.Instruments.All[Instr], SquareOnCh2); |
| 580 |
end; |
583 |
end; |
| 581 |
|
584 |
|
| 582 |
procedure TfrmTracker.PreviewInstrument(Freq: Integer; Instr: TInstrument); |
585 |
procedure TfrmTracker.PreviewInstrument(Freq: Integer; Instr: TInstrument; |
|
|
586 |
SquareOnCh2: Boolean = False); |
| 583 |
var |
587 |
var |
| 584 |
Regs: TRegisters; |
588 |
Regs: TRegisters; |
| 585 |
begin |
589 |
begin |
@@ -591,11 +595,19 @@ begin |
| 591 |
case Type_ of |
595 |
case Type_ of |
| 592 |
itSquare: begin |
596 |
itSquare: begin |
| 593 |
Regs := SquareInstrumentToRegisters(Freq, True, Instr); |
597 |
Regs := SquareInstrumentToRegisters(Freq, True, Instr); |
| 594 |
Spokeb(NR10, Regs.NR10); |
598 |
if SquareOnCh2 then begin |
| 595 |
Spokeb(NR11, Regs.NR11); |
599 |
Spokeb(NR21, Regs.NR11); |
| 596 |
Spokeb(NR12, Regs.NR12); |
600 |
Spokeb(NR22, Regs.NR12); |
| 597 |
Spokeb(NR13, Regs.NR13); |
601 |
Spokeb(NR23, Regs.NR13); |
| 598 |
Spokeb(NR14, Regs.NR14); |
602 |
Spokeb(NR24, Regs.NR14); |
|
|
603 |
end |
|
|
604 |
else begin |
|
|
605 |
Spokeb(NR10, Regs.NR10); |
|
|
606 |
Spokeb(NR11, Regs.NR11); |
|
|
607 |
Spokeb(NR12, Regs.NR12); |
|
|
608 |
Spokeb(NR13, Regs.NR13); |
|
|
609 |
Spokeb(NR14, Regs.NR14); |
|
|
610 |
end; |
| 599 |
end; |
611 |
end; |
| 600 |
itWave: begin |
612 |
itWave: begin |
| 601 |
CopyWaveIntoWaveRam(Waveform); |
613 |
CopyWaveIntoWaveRam(Waveform); |
@@ -1164,7 +1176,17 @@ begin |
| 1164 |
|
1176 |
|
| 1165 |
if not NotesToFreqs.TryGetData(Note, Freq) then Exit; |
1177 |
if not NotesToFreqs.TryGetData(Note, Freq) then Exit; |
| 1166 |
|
1178 |
|
| 1167 |
PreviewInstrument(Freq, InstrumentComboBox.ItemIndex); |
1179 |
case TrackerGrid.Cursor.X of |
|
|
1180 |
0..1: InstrumentComboBox.ItemIndex := UnmodInst(itSquare, TrackerGrid.SelectedInstrument); |
|
|
1181 |
2: InstrumentComboBox.ItemIndex := UnmodInst(itWave, TrackerGrid.SelectedInstrument); |
|
|
1182 |
3: InstrumentComboBox.ItemIndex := UnmodInst(itNoise, TrackerGrid.SelectedInstrument); |
|
|
1183 |
end; |
|
|
1184 |
|
|
|
1185 |
if TrackerGrid.Cursor.X = 1 then |
|
|
1186 |
PreviewInstrument(Freq, InstrumentComboBox.ItemIndex, True) |
|
|
1187 |
else |
|
|
1188 |
PreviewInstrument(Freq, InstrumentComboBox.ItemIndex, False); |
|
|
1189 |
|
| 1168 |
PreviewingInstrument := Note; |
1190 |
PreviewingInstrument := Note; |
| 1169 |
end; |
1191 |
end; |
| 1170 |
|
1192 |
|