Vibrato optimizations (#530)

Optimize vibrato to even exceed vanilla's implementation, all without restricting usability from the current implementation. This should save up to about 1ms of audio runtime.
This commit is contained in:
Gregory Heskett
2023-01-20 17:45:53 -05:00
committed by GitHub
parent 65d29dc337
commit dc71aef024
6 changed files with 68 additions and 30 deletions

View File

@@ -226,7 +226,7 @@ chan_end
.delay_interrupt:
chan_setpanmix 127
chan_setvolscale 127
chan_setvibratoextent 0
chan_setvibratoextent 0xff // 0xff represents disabled value
chan_ioreadval 1 // IO slots 0-3 are reset to -1 when read; restore the value
chan_iowriteval 0
chan_break // break out of the loop
@@ -1147,6 +1147,9 @@ chan_setbank 4
chan_setinstr 14
chan_setdecayrelease 12
chan_setvibratoextent 10
chan_setval 0x7f
chan_call .delay
chan_setvibratoextent 0xff
chan_end
.layer_68F:
@@ -1317,7 +1320,7 @@ chan_setlayer 0, .layer_79D
chan_setlayer 1, .layer_79B
chan_setval 36
chan_call .delay
chan_setvibratoextent 0
chan_setvibratoextent 0xff
chan_end
.layer_79B:
@@ -3025,6 +3028,9 @@ chan_setvibratorate 60
chan_setval 25
chan_call .set_reverb
chan_setlayer 0, .layer_11E4
chan_setval 0x45
chan_call .delay
chan_setvibratoextent 0xff
chan_end
.layer_11E4:
@@ -3070,7 +3076,7 @@ chan_setbank 4
chan_setinstr 6
chan_setval 49
chan_call .delay
chan_setvibratoextent 0
chan_setvibratoextent 0xff
chan_end
.layer_1242:
@@ -4389,7 +4395,7 @@ chan_setlayer 0, .layer_1AEB
chan_setlayer 1, .layer_1AE9
chan_setval 35
chan_call .delay
chan_setvibratoextent 0
chan_setvibratoextent 0xff
chan_end
.layer_1AE9:
@@ -6055,7 +6061,7 @@ chan_setvibratorate 60
chan_setlayer 0, .layer_259B
chan_setval 30
chan_call .delay
chan_setvibratoextent 0
chan_setvibratoextent 0xff
chan_end
.layer_259B:
@@ -6189,7 +6195,7 @@ chan_setvibratorate 5
chan_setlayer 0, .layer_2684
chan_setval 88
chan_call .delay
chan_setvibratoextent 0
chan_setvibratoextent 0xff
chan_end
.layer_2684:
@@ -6360,7 +6366,7 @@ chan_setlayer 0, .layer_27B7
chan_setlayer 1, .layer_27B5
chan_setval 56
chan_call .delay
chan_setvibratoextent 0
chan_setvibratoextent 0xff
chan_end
.layer_27B5:
@@ -7067,6 +7073,9 @@ chan_setenvelope .envelope_3444
chan_setvibratorate 1
chan_setvibratoextent 100
chan_setlayer 0, .layer_2CA0
chan_setval 0x12
chan_call .delay
chan_setvibratoextent 0xff
chan_end
.layer_2CA0:
@@ -7094,7 +7103,7 @@ chan_call .delay
chan_setvibratoextent 80
chan_setval 67
chan_call .delay
chan_setvibratoextent 0
chan_setvibratoextent 0xff
chan_end
.layer_2CD6:
@@ -7292,6 +7301,13 @@ chan_setval 70
chan_call .delay
chan_setbank 10
chan_setinstr 8
chan_setval 0x7f
chan_call .delay
chan_setval 0x7f
chan_call .delay
chan_setval 0x4
chan_call .delay
chan_setvibratoextent 0xff
chan_end
.layer_2E28: