Merge pull request #32 from RichardULZ/effect-preview
Use 2 sliders for C Volume effect, with Envelope and Volume
4 changed files
Diffed against the first of 2 parents.
+18−10
d237fceUse 2 sliders for C Volume effect, with Envelope and Volume
@@ -365,9 +365,8 @@ end; | |||
| 365 | |
365 | |
| 366 | procedure TfrmEffectEditor.fxC; |
366 | procedure TfrmEffectEditor.fxC; |
| 367 | begin |
367 | begin |
| 368 | Notebook1.PageIndex := 0; |
368 | Notebook1.PageIndex := 1; |
| 369 | OneParamTrackBar.Max := $F; |
369 | LoadTwoParamData; |
| 370 | LoadOneParamData; |
|
|
| 371 | end; |
370 | end; |
| 372 | |
371 | |
| 373 | procedure TfrmEffectEditor.fxD; |
372 | procedure TfrmEffectEditor.fxD; |
@@ -115,6 +115,10 @@ begin | |||
| 115 | end |
115 | end |
| 116 | else |
116 | else |
| 117 | case Code of |
117 | case Code of |
|
118 | $9: begin |
|
|
119 | OutCode := $C; |
|
|
120 | OutParams.Value := Swap(Params); |
|
|
121 | end; |
|
| 118 | $C: begin |
122 | $C: begin |
| 119 | OutCode := $C; |
123 | OutCode := $C; |
| 120 | OutParams.Value := Trunc((Params / $40)*$F); |
124 | OutParams.Value := Trunc((Params / $40)*$F); |
@@ -588,14 +588,14 @@ end; | |||
| 588 | |
588 | |
| 589 | procedure TfrmTracker.DrawWaveform(PB: TPaintBox; Wave: TWave); |
589 | procedure TfrmTracker.DrawWaveform(PB: TPaintBox; Wave: TWave); |
| 590 | var |
590 | var |
| 591 | Interval{, HInterval}: Integer; |
591 | Interval{, HInterval}: Single; |
| 592 | I: Integer; |
592 | I: Integer; |
| 593 | W, H : Integer; |
593 | W, H : Integer; |
| 594 | begin |
594 | begin |
| 595 | W := PB.Width; |
595 | W := PB.Width; |
| 596 | H := PB.Height; |
596 | H := PB.Height-4; |
| 597 | |
597 | |
| 598 | Interval := W div 31; |
598 | Interval := W / 32; |
| 599 | //HInterval := H div $10; |
599 | //HInterval := H div $10; |
| 600 | With PB.Canvas do begin |
600 | With PB.Canvas do begin |
| 601 | Brush.Color := clGameboyBlack; |
601 | Brush.Color := clGameboyBlack; |
@@ -614,7 +614,7 @@ begin | |||
| 614 | Pen.Width := 2; |
614 | Pen.Width := 2; |
| 615 | MoveTo(0, H); |
615 | MoveTo(0, H); |
| 616 | for I := Low(Wave) to High(Wave) do |
616 | for I := Low(Wave) to High(Wave) do |
| 617 | LineTo(I*Interval, Trunc((Wave[I]/$F)*H)); |
617 | LineTo(Round(I*Interval), Trunc((Wave[I]/$F)*H)+2); |
| 618 | LineTo(W, Trunc((Wave[0]/$F)*H)); |
618 | LineTo(W, Trunc((Wave[0]/$F)*H)); |
| 619 | end; |
619 | end; |
| 620 | end; |
620 | end; |
@@ -2565,8 +2565,8 @@ begin | |||
| 2565 | X := EnsureRange(X, 0, WaveEditPaintBox.Width); |
2565 | X := EnsureRange(X, 0, WaveEditPaintBox.Width); |
| 2566 | Y := EnsureRange(Y, 0, WaveEditPaintBox.Height); |
2566 | Y := EnsureRange(Y, 0, WaveEditPaintBox.Height); |
| 2567 | if DrawingWave then begin |
2567 | if DrawingWave then begin |
| 2568 | Idx := EnsureRange(Trunc((X / WaveEditPaintBox.Width)*High(TWave)), Low(TWave), High(TWave)); |
2568 | Idx := EnsureRange(Round((X / WaveEditPaintBox.Width)*32), Low(TWave), High(TWave)); |
| 2569 | CurrentWave^[Idx] := EnsureRange(Trunc((Y / WaveEditPaintBox.Height)*$F), 0, $F); |
2569 | CurrentWave^[Idx] := EnsureRange(Round((Y / WaveEditPaintBox.Height)*$F), 0, $F); |
| 2570 | UpdateHexWaveTextbox; |
2570 | UpdateHexWaveTextbox; |
| 2571 | WaveEditPaintBox.Invalidate; |
2571 | WaveEditPaintBox.Invalidate; |
| 2572 | if PlayWaveWhileDrawingCheckbox.Checked then |
2572 | if PlayWaveWhileDrawingCheckbox.Checked then |
@@ -92,7 +92,12 @@ begin | |||
| 92 | $7: Result := 'Delay note by '+P+' ticks'; |
92 | $7: Result := 'Delay note by '+P+' ticks'; |
| 93 | $A: Result := 'Increase volume by '+IntToStr(Params.Param1)+' units, decrease volume by '+IntToStr(Params.Param2)+' units'; |
93 | $A: Result := 'Increase volume by '+IntToStr(Params.Param1)+' units, decrease volume by '+IntToStr(Params.Param2)+' units'; |
| 94 | $B: Result := 'Jump to order '+P; |
94 | $B: Result := 'Jump to order '+P; |
| 95 | $C: Result := 'Set volume to '+P+'/15'; |
95 | $C: begin |
|
96 | if (Params.Value < 16) then Result := 'Keep envelope, Set volume to '+IntToStr(Params.Param2)+'/15' |
|
|
97 | else if (Params.Value < 128) then Result := 'Envelope Down '+IntToStr(Params.Param1)+'/64Hz, Set volume to '+IntToStr(Params.Param2)+'/15' |
|
|
98 | else if (Params.Value < 144) then Result := 'Envelope Off, Set volume to '+IntToStr(Params.Param2)+'/15' |
|
|
99 | else Result := 'Envelope Up '+IntToStr(Params.Param1-8)+'/64Hz, Set volume to '+IntToStr(Params.Param2)+'/15' |
|
|
100 | end; |
|
| 96 | $D: Result := 'Jump to row '+P+' on the next pattern'; |
101 | $D: Result := 'Jump to row '+P+' on the next pattern'; |
| 97 | $E: Result := 'Cut note after '+P+' ticks'; |
102 | $E: Result := 'Cut note after '+P+' ticks'; |
| 98 | $F: Result := 'Set speed to '+P+' ticks'; |
103 | $F: Result := 'Set speed to '+P+' ticks'; |