This repository was archived by the owner on Mar 26, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiss_plfx.pas
More file actions
783 lines (644 loc) · 24 KB
/
iss_plfx.pas
File metadata and controls
783 lines (644 loc) · 24 KB
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
{
Copyright (c) 1998-2001,2014 Karoly Balogh <charlie@amigaspirit.hu>
Permission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted, provided that the
above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
}
{ * ISS_PLFX.PAS - Effect handlers for the module player }
{ OS - Platform Independent }
{ * >>> NO UNIT HEADER, BECAUSE THIS IS AN INCLUDE FILE!!! <<< * }
{ * >>> E F F E C T I D N U M B E R S <<< * }
Const { * Effect Numbers * }
FXPortaUp = 1; { * 01-1xx Portamento Up (MOD) * }
FXPortaDown = 2; { * 02-2xx Portamento Down (MOD) * }
FXPortaNote = 3; { * 03-3xx Portamento to Note (MOD) * }
FXVibrato = 4; { * 04-4xy Vibrato (MOD) * }
FXPortVolSlide = 5; { * 05-5xy Portamento+Volume Slide (MOD) * }
FXVibVolSlide = 6; { * 06-6xy Vibrato+Volume Slide (MOD) * }
FXTremolo = 7; { * 07-7xy Tremolo (MOD) * }
FXSetPanning = 8; { * 08-8xx Set Panning ($0-$80) (MOD/DMP) * }
FXSetOffset = 9; { * 09-9xx Set Sample Offset (MOD) * }
FXVolumeSlide = 10; { * 10-Axy Volume Slide (MOD) * }
FXJump = 11; { * 11-Bxx Jump to pattern (MOD) * }
FXSetVolume = 12; { * 12-Cxx Set Volume (MOD) * }
FXPatBreak = 13; { * 13-Dxx Pattern Break (MOD) * }
{ * 14-Exy Extended Effects (36+x) * }
FXSetTempoBPM = 15; { * 15-Fxx Set Speed/Set BPM (MOD) * }
FXSetGVolume = 16; { * 16-Gxx Set Global Volume (S3M/XM) * }
FXGVolumeSlide = 17; { * 17-Hxx Global Volume Slide (XM) * }
FXRetrig = 45; { * 45-E9x Retrig Note (MOD) * }
FXFineVolSldUp = 46; { * 46-EAx Fine Volume Slide Up (MOD) * }
FXFineVolSldDn = 47; { * 47-EBx Fine Volume Slide Down (MOD) * }
FXCutNote = 48; { * 48-ECx Cut Note (MOD) * }
FXNoteDelay = 49; { * 49-EDx Delay Note (MOD) * }
FXKeyOff = 97; { * Key Off * }
FXNoEffect = 255; { * No effect * }
{ * Volume Commands * }
FXVolSlideDn = 1; { * Volume Slide Down * }
FXVolSlideUp = 2; { * Volume Slide Up * }
FXVolFineSldDn = 3; { * Fine Volume Slide Down * }
FXVolFineSldUp = 4; { * Fine Volume Slide Up * }
FXVolSetVibSpd = 5; { * Set vibrato speed * }
FXVolVibrato = 6; { * Vibrato * }
FXVolSetPan = 7; { * Set Panning * }
FXVolPanSlideL = 8; { * Panning Slide Left * }
FXVolPanSlideR = 9; { * Panning Slide Right * }
FXVolPortaNote = 10; { * Porta To Note * }
FXVolNoEffect = 255; { * No effect * }
{ * >>> V O L U M E E F F E C T S U S T A I N <<< * }
{ * Command : Do Volume Slide Down * }
Procedure DoVVolumeSlideDn;
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
If ChVolume<ChVVolSlideData Then ChVolume:=0
Else Dec(ChVolume,ChVVolSlideData);
ISS_SetVolume(CChannel,ChVolume);
End;
End;
End;
{ * Command : Do Volume Slide Up * }
Procedure DoVVolumeSlideUp;
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
Inc(ChVolume,ChVVolSlideData);
If ChVolume>64 Then ChVolume:=64;
ISS_SetVolume(CChannel,ChVolume);
End;
End;
End;
{ * Command : Do Panning Slide Left * }
Procedure DoVPanningSlideLeft;
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
If ChPanning<ChVPanSlideData Then ChPanning:=0
Else Dec(ChPanning,ChVPanSlideData);
ISS_SetPanning(CChannel,ChPanning);
End;
End;
End;
{ * Command : Do Panning Slide Right * }
Procedure DoVPanningSlideRight;
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
If ChPanning+ChVPanSlideData>255 Then ChPanning:=255
Else Inc(ChPanning,ChVPanSlideData);
ISS_SetPanning(CChannel,ChPanning);
End;
End;
End;
{ * >>> V O L U M E E F F E C T P R O C E S S I N G <<< * }
{ * Command : Process Volume Slide Up or Down * }
Procedure ProcVVolumeSlide(VolToSlide : Word);
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
ChVVolSlideData:=VolToSlide;
End;
End;
End;
{ * Command : Process Volume Panning * }
Procedure ProcVSetPanning(PanToSet : Word);
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
ChPanning:=(PanToSet Shl 4)+PanToSet;
ISS_SetPanning(CChannel,ChPanning);
End;
End;
End;
{ * Command : Process Volume Panning Slide * }
Procedure ProcVPanningSlide(PanToSlide : Word);
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
ChVPanSlideData:=PanToSlide;
End;
End;
End;
{ * >>> E F F E C T S U S T A I N <<< * }
{ * Command : Do Portamento Up * }
Procedure DoPortaUp;
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
Dec(ChPeriod,ChPortaUpData);
ISS_SetPeriod(CChannel,ChPeriod);
End;
End;
End;
{ * Command : Do Portamento Down * }
Procedure DoPortaDown;
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
Inc(ChPeriod,ChPortaDownData);
ISS_SetPeriod(CChannel,ChPeriod);
End;
End;
End;
{ * Command : Do Porta To Note * }
Procedure DoPortaNote;
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
If ChPeriod<ChPortaToNotePeriod Then Begin
Inc(ChPeriod,ChPortaToNoteData);
If ChPeriod>ChPortaToNotePeriod Then ChPeriod:=ChPortaToNotePeriod;
ISS_SetPeriod(CChannel,ChPeriod);
End Else
If ChPeriod>ChPortaToNotePeriod Then Begin
Dec(ChPeriod,ChPortaToNoteData);
If ChPeriod<ChPortaToNotePeriod Then ChPeriod:=ChPortaToNotePeriod;
ISS_SetPeriod(CChannel,ChPeriod);
End;
End;
End;
End;
{ * Command : Do Vibrato * }
Procedure DoVibrato;
Var BufPeriod : DWord;
BufVibValue : Byte;
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
BufPeriod:=ChPeriod;
BufVibValue:=((ISS_SineTable[ChVibPosition And 127]*ChVibDepth) Div 128);
If ChVibPosition<127 Then Inc(BufPeriod,BufVibValue)
Else Dec(BufPeriod,BufVibValue);
ISS_SetPeriod(CChannel,BufPeriod);
Inc(ChVibPosition,ChVibSpeed*4);
End;
End;
End;
{ * Command : Do Volume Slide * }
Procedure DoVolumeSlide;
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
ChVolume:=ChVolume+ChVolSlideData;
If ChVolume>64 Then ChVolume:=64;
If ChVolume<0 Then ChVolume:=0;
ISS_SetVolume(CChannel,ChVolume);
End;
End;
End;
{ * Command : Do Retrig * }
Procedure DoRetrig;
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
If ChFXTick=0 Then Exit;
If (TickCnt Mod ChFXTick)=0 Then Begin
ISS_SetSampleOffset(CChannel,0); { * Retrig * }
End;
End;
End;
End;
{ * Command : Do Portamento+VolumeSlide * }
Procedure DoPortVolSlide;
Begin
DoPortaNote;
DoVolumeSlide;
End;
{ * Command : Do Vibrato+VolumeSlide * }
Procedure DoVibVolSlide;
Begin
DoVibrato;
DoVolumeSlide;
End;
{ * Command : Do Tremolo * }
Procedure DoTremolo;
Var BufVolume : Integer;
BufTremValue : Byte;
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
BufVolume:=ChVolume;
BufTremValue:=((ISS_SineTable[ChTremPosition And 127]*ChTremDepth) Div 64);
If ChTremPosition<127 Then Begin
Inc(BufVolume,BufTremValue);
If BufVolume>64 Then BufVolume:=64;
End Else Begin
Dec(BufVolume,BufTremValue);
If BufVolume<0 Then BufVolume:=0;
End;
ISS_SetVolume(CChannel,BufVolume);
Inc(ChTremPosition,ChTremSpeed*4);
End;
End;
End;
{ * Command : Do Global Volume Slide * }
Procedure DoGVolumeSlide;
Var BufVol : LongInt;
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
BufVol:=ISS_GlobalPlVolume+ChGVolSlideData;
If BufVol<0 Then Begin ISS_GlobalPlVolume:=0; Exit; End;
If BufVol>64 Then Begin ISS_GlobalPlVolume:=64; Exit; End;
ISS_GlobalPlVolume:=BufVol;
End;
End;
End;
{ * Command : Cut Note * }
Procedure DoCutNote;
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
If TickCnt=ChFXTick Then Begin
ChVolume:=0;
ISS_SetVolume(CChannel,ChVolume); { * Cut Note * }
End;
End;
End;
End;
{ * Command : Do Note Delay * }
Procedure DoNoteDelay;
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
{ * If Tick counter reached specified value, we start the note * }
If TickCnt=ChFXTick Then Begin
CNote :=ChRNote;
CInstr:=ChRInstr;
If CNote<>0 Then Begin
ISSPlay_StartNote;
End;
End;
End;
End;
End;
{ * >>> E F F E C T P R O C E S S I N G <<< * }
{ * Command : Process Portamento Up * }
Procedure ProcPortaUp(PortaTo : Word);
Begin
With ISS_Player^ Do Begin
If PortaTo<>0 Then Channels[CChannel].ChPortaUpData:=PortaTo Shl 2;
End;
End;
{ * Command : Process Portamento Down * }
Procedure ProcPortaDown(PortaTo : Word);
Begin
With ISS_Player^ Do Begin
If PortaTo<>0 Then Channels[CChannel].ChPortaDownData:=PortaTo Shl 2;
End;
End;
{ * Command : Process Porta To Note * }
Procedure ProcPortaNote(PortaTo : Word);
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin;
If PortaTo<>0 Then
ChPortaToNoteData:=PortaTo Shl 2;
If (CNote>0) And (CNote<97) Then
ChPortaToNotePeriod:=ISS_ChGetNotePeriod(CChannel,CNote);
{ * Porta to note processed in the head tick too * }
// DoPortaNote; // NOT FOR MOD!!!
End;
End;
End;
{ * Command : Process Vibrato * }
Procedure ProcVibrato(VibValues : Word);
Var VibSpeed : Byte;
VibDepth : Byte;
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
VibSpeed:=(VibValues And $0F0) Shr 4;
VibDepth:=VibValues And $00F;
{ * If a parameter is zero, we're using previous values * }
If VibSpeed>0 Then ChVibSpeed:=VibSpeed;
If VibDepth>0 Then ChVibDepth:=VibDepth;
{ * If previous command wasn't vibrato and we're in retrigger * }
{ * mode, then retrig vibrato * }
If (ChFXType<>FXVibrato) And (ChFXType<>FXVibVolSlide) And
(ChVibWaveForm<4) Then ChVibPosition:=0;
{ * Vibrato processed in the head tick too * }
DoVibrato; // NOT FOR MOD!!!
End;
End;
End;
{ * Command : Process Set Panning * }
Procedure ProcSetPanning(PanToSet : Word);
Begin
With ISS_Player^ Do Begin
ISS_SetPanning(CChannel,PanToSet);
End;
End;
{ * Command : Process Sample Offset * }
Procedure ProcSetSampOffset(OffsetToSet : Word);
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
{ * Store offset if it it's not zero * }
If OffsetToSet<>0 Then ChSampleOffset:=OffsetToSet;
{ * Set the sample offset. If the current parameter is zero, we * }
{ * using the previous value * }
If CNote<>0 Then ISS_SetSampleOffset(CChannel,ChSampleOffset * $100);
End;
End;
End;
{ * Command : Process Volume Slide * }
Procedure ProcVolumeSlide(VolToSlide : Word);
Var VolSlideUp : Byte;
VolSlideDn : Byte;
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
VolSlideUp:=(VolToSlide And $0F0) Shr 4;
VolSlideDn:=VolToSlide And $00F;
If (VolSlideUp>0) And (VolSlideDn>0) Then Begin
{ * Up & Downslide can't performed together, so we do nothing * }
{ * in this case * }
ChVolSlideData:=0;
End Else Begin
{ * Upslide? * }
If (VolSlideUp>0) Then Begin
ChVolSlideData:=VolSlideUp;
End;
{ * Downslide? * }
If (VolSlideDn>0) Then Begin
ChVolSlideData:=0-VolSlideDn;
End;
End;
End;
End;
End;
{ * Command : Process Jump To Pattern * }
Procedure ProcJump(OrderToJump : Word);
Begin
With ISS_Player^ Do Begin
With ISS_CurrentModule^ Do Begin
If OrderToJump>MSongLength-1 Then OrderToJump:=MSongLength-1;
End;
NextRow:=0;
NextOrder:=OrderToJump;
End;
End;
{ * Command : Process Set Volume * }
Procedure ProcSetVolume(VolumeToSet : Word);
Begin
With ISS_Player^ Do Begin
Channels[CChannel].ChVolume:=VolumeToSet;
ISS_SetVolume(CChannel,VolumeToSet);
End;
End;
{ * Command : Process Pattern Break * }
Procedure ProcPatBreak(RowToBreak : Word);
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
NextRow:=(((RowToBreak And $0F0) Shr 4)*10)+(RowToBreak And $00F);
If NextOrder=-1 Then NextOrder:=Order+1;
End;
End;
End;
{ * Command : Process Portamento+VolumeSlide * }
Procedure ProcPortVolSlide(VolToSlide : Word);
Begin
With ISS_Player^ Do Begin
ProcPortaNote(0);
If ISS_CurrentModule^.MTracker=ISS_TrackerID_PRO Then Begin
If VolToSlide=0 Then VolToSlide:=ISS_GetVolume(CChannel);
End;
ProcVolumeSlide(VolToSlide);
End;
End;
{ * Command : Process Vibrato+VolumeSlide * }
Procedure ProcVibVolSlide(VolToSlide : Word);
Begin
With ISS_Player^ Do Begin
ProcVibrato(0);
If ISS_CurrentModule^.MTracker=ISS_TrackerID_PRO Then Begin
If VolToSlide=0 Then VolToSlide:=ISS_GetVolume(CChannel);
End;
ProcVolumeSlide(VolToSlide);
End;
End;
{ * Command : Process Tremolo * }
Procedure ProcTremolo(TremValues : Word);
Var TremSpeed : Byte;
TremDepth : Byte;
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
TremSpeed:=(TremValues And $0F0) Shr 4;
TremDepth:=TremValues And $00F;
{ * If a parameter is zero, we're using previous values * }
If TremSpeed>0 Then ChTremSpeed:=TremSpeed;
If TremDepth>0 Then ChTremDepth:=TremDepth;
{ * If previous command wasn't tremolo and we're in retrigger * }
{ * mode, then retrig tremolo * }
If (ChFXType<>FXTremolo) And (ChTremWaveForm<4) Then ChTremPosition:=0;
End;
End;
End;
{ * Command : Process Set BPM * }
Procedure ProcSetBPM(BPMToSet : Word);
Begin
If BPMToSet=0 Then Exit;
With ISS_Player^ Do Begin
BPM :=BPMToSet;
BPMVal:=(1193180*5) Div (BPMToSet Shl 1);
End;
End;
{ * Command : Process Set Tempo/BPM * }
Procedure ProcSetTempo_BPM(TempoToSet : Word);
Begin
If TempoToSet>=$20 Then Begin ProcSetBPM(TempoToSet); Exit; End;
ISS_Player^.Speed:=TempoToSet;
End;
{ * Command : Process Set Global Volume * }
Procedure ProcSetGlobalVolume(VolToSet : Word);
Begin
If VolToSet>64 Then ISS_GlobalPlVolume:=64
Else ISS_GlobalPlVolume:=VolToSet;
End;
{ * Command : Process Global Volume Slide * }
Procedure ProcGVolumeSlide(VolToSlide : Word);
Var VolSlideUp : Byte;
VolSlideDn : Byte;
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
VolSlideUp:=(VolToSlide And $0F0) Shr 4;
VolSlideDn:=VolToSlide And $00F;
{ * Up & Downslide can't performed together, so we do nothing * }
{ * in this case * }
If (VolSlideUp>0) And (VolSlideDn>0) Then Exit;
{ * Upslide? * }
If (VolSlideUp>0) Then Begin
ChGVolSlideData:=VolSlideUp;
End;
{ * Downslide? * }
If (VolSlideDn>0) Then Begin
ChGVolSlideData:=0-VolSlideDn;
End;
End;
End;
End;
{ * Command : Process Fine Volume Slide Up * }
Procedure ProcFinePortaUp(FreqToSub : Word);
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
{ Inc(ChVolume,VolToAdd);
If ChVolume>64 Then ChVolume:=64;
ISS_SetVolume(CChannel,ChVolume);}
End;
End;
End;
{ * Command : Process Fine Volume Slide Down * }
Procedure ProcFinePortaDown(FreqToAdd : Word);
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
{ If ChVolume<VolToSub Then ChVolume:=0
Else Dec(ChVolume,VolToSub);
ISS_SetVolume(CChannel,ChVolume);}
End;
End;
End;
{ * Command : Process Fine Volume Slide Up * }
Procedure ProcFineVolSldUp(VolToAdd : Word);
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
Inc(ChVolume,VolToAdd);
If ChVolume>64 Then ChVolume:=64;
ISS_SetVolume(CChannel,ChVolume);
End;
End;
End;
{ * Command : Process Fine Volume Slide Down * }
Procedure ProcFineVolSldDn(VolToSub : Word);
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
If ChVolume<VolToSub Then ChVolume:=0
Else Dec(ChVolume,VolToSub);
ISS_SetVolume(CChannel,ChVolume);
End;
End;
End;
{ * Command : Cut Note * }
Procedure ProcCutNote(TickUntilCut : Word);
Begin
With ISS_Player^ Do Begin
Channels[CChannel].ChFXTick:=TickUntilCut;
End;
End;
{ * Command : Note Delay * }
Procedure ProcNoteDelay(TickUntilNote : Word);
Begin
With ISS_Player^ Do Begin
With Channels[CChannel] Do Begin
If CNote<>0 Then Begin
If TickUntilNote=0 Then ChFXTick:=Speed+1
Else ChFXTick:=TickUntilNote;
End;
End;
End;
DoNoteDelay;
End;
{ * Process Tick Based Commands (NoteCut, etc) * }
Procedure ProcTick(Parameter : Word);
Begin
With ISS_Player^ Do Begin
Channels[CChannel].ChFXTick:=Parameter;
ISSPlay_DoFX(CFXType);
End;
End;
{ * >>> T H E D U M M Y P R O C E D U R E S <<< * }
Procedure ProcDummy(Parameter : Word);
Begin
End;
Procedure DoDummy;
Begin
End;
{ * >>> E F F E C T P R O C E D U R E T A B L E S <<< * }
Type TFXHandler = Record
Proc : Procedure(FXParam : Word);
Sust : Procedure;
End;
Const { * The processing table * }
FXProcs : Array[0..51] Of TFXHandler = (
{ * Normal effects * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 00-0xx Arpeggio !(MOD) * }
(Proc:@ProcPortaUp; Sust:@DoPortaUp), { * 01-1xx Portamento Up (MOD) * }
(Proc:@ProcPortaDown; Sust:@DoPortaDown), { * 02-2xx Portamento Down (MOD) * }
(Proc:@ProcPortaNote; Sust:@DoPortaNote), { * 03-3xx Portamento to Note (MOD) * }
(Proc:@ProcVibrato; Sust:@DoVibrato), { * 04-4xy Vibrato (MOD) * }
(Proc:@ProcPortVolSlide; Sust:@DoPortVolSlide), { * 05-5xy Portamento+Volume Slide (MOD) * }
(Proc:@ProcVibVolSlide; Sust:@DoVibVolSlide), { * 06-6xy Vibrato+Volume Slide (MOD) * }
(Proc:@ProcTremolo; Sust:@DoTremolo), { * 07-7xy Tremolo (MOD) * }
(Proc:@ProcSetPanning; Sust:@DoDummy), { * 08-8xx Set Panning ($0-$80) (MOD/DMP) * }
(Proc:@ProcSetSampOffset; Sust:@DoDummy), { * 09-9xx Set Sample Offset (MOD) * }
(Proc:@ProcVolumeSlide; Sust:@DoVolumeSlide), { * 10-Axy Volume Slide (MOD) * }
(Proc:@ProcJump; Sust:@DoDummy), { * 11-Bxx Jump to pattern (MOD) * }
(Proc:@ProcSetVolume; Sust:@DoDummy), { * 12-Cxx Set Volume (MOD) * }
(Proc:@ProcPatBreak; Sust:@DoDummy), { * 13-Dxx Pattern Break (MOD) * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 14-Exy Extended Effects (36+x) * }
(Proc:@ProcSetTempo_BPM; Sust:@DoDummy), { * 15-Fxx Set Speed/Set BPM (MOD) * }
(Proc:@ProcSetGlobalVolume;Sust:@DoDummy), { * 16-Gxx Set Global Volume (S3M/XM) * }
(Proc:@ProcGVolumeSlide; Sust:@DoGVolumeSlide), { * 17-Hxx Global Volume Slide (XM) * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 18-I * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 19-J * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 20-Kxx Key Off (after xx tick)!(XM) * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 21-Lxx Set Envelope Pos !(XM) * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 22-M * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 23-N * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 24-O * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 25-Pxx Panning Slide !(XM) * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 26-Q * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 27-Rxy Multi Retrig Note !(S3M) * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 28-S * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 29-Txy Tremor !(STM) * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 30-U * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 31-V * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 32-W * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 33-Xxy Extra Fine Portamento !(S3M) * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 31-Y * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 32-Z * }
{ * Extended effects * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 36-E0x Set AMiGA Filter #(MOD) * }
(Proc:@ProcFinePortaUp; Sust:@DoDummy), { * 37-E1x Fine Portamento Up !(MOD) * }
(Proc:@ProcFinePortaDown; Sust:@DoDummy), { * 38-E1x Fine Portamento Down !(MOD) * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 39-E3x Glissando Control #(MOD) * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 40-E4x Set Vibrato Waveform !(MOD) * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 41-E5x Set Finetune !(MOD) * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 42-E6x Pattern Loop !(MOD) * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 43-E7x Set Tremolo WaveForm !(MOD) * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 44-E8x Unused/Set Panning !(MOD/S3M) * }
(Proc:@ProcTick; Sust:@DoRetrig), { * 45-E9x Retrig Note (MOD) * }
(Proc:@ProcFineVolSldUp; Sust:@DoDummy), { * 46-EAx Fine Volume Slide Up (MOD) * }
(Proc:@ProcFineVolSldDn; Sust:@DoDummy), { * 47-EAx Fine Volume Slide Down (MOD) * }
(Proc:@ProcCutNote; Sust:@DoCutNote), { * 48-ECx Cut Note (MOD) * }
(Proc:@ProcNoteDelay; Sust:@DoNoteDelay), { * 49-EDx Delay Note (MOD) * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 50-EEx Pattern Delay !(MOD) * }
(Proc:@ProcDummy; Sust:@DoDummy)); { * 51-EFx Invert Loop, Synchro #(MOD) * }
Const { * The volume effect processing table * }
FXVolProcs : Array[0..10] Of TFXHandler = (
(Proc:@ProcDummy; Sust:@DoDummy), { * 0 - * }
(Proc:@ProcVVolumeSlide; Sust:@DoVVolumeSlideDn), { * 1 - Volume Slide Down * }
(Proc:@ProcVVolumeSlide; Sust:@DoVVolumeSlideUp), { * 2 - Volume Slide Up * }
(Proc:@ProcFineVolSldDn; Sust:@DoDummy), { * 3 - Fine Volume Slide Down * }
(Proc:@ProcFineVolSldUp; Sust:@DoDummy), { * 4 - Fine Volume Slide Up * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 5 - Set vibrato speed ! * }
(Proc:@ProcDummy; Sust:@DoDummy), { * 6 - Vibrato ! * }
(Proc:@ProcVSetPanning; Sust:@DoDummy), { * 7 - Set Panning * }
(Proc:@ProcVPanningSlide; Sust:@DoVPanningSlideLeft), { * 8 - Panning Slide Left * }
(Proc:@ProcVPanningSlide; Sust:@DoVPanningSlideRight), { * 9 - Panning Slide Right * }
(Proc:@ProcDummy; Sust:@DoDummy)); { * A - Porta to Note ! * }