History

Update pt2_tables.c

Olav Sørensen committed 4 years ago

Commit 1e0ed4c1 parent 5d295f01 file · +38 −8Browse files

Unified · Split

src/pt2_tables.c+38−8
@@ -86,64 +86,94 @@ const uint8_t vibratoTable[32] = · 85 unmodified lines
8686 0xB4, 0xA1, 0x8D, 0x78, 0x61, 0x4A, 0x31, 0x18
8787 };
8888
89−const int16_t periodTable[(37*16)+15] =
89+const int16_t periodTable[(37*16)+15] = // contains 16 finetuned period sections
9090 {
91+ // finetune 0 (no finetuning)
9192 856,808,762,720,678,640,604,570,538,508,480,453,
9293 428,404,381,360,339,320,302,285,269,254,240,226,
9394 214,202,190,180,170,160,151,143,135,127,120,113,0,
95+
96+ // finetune +1
9497 850,802,757,715,674,637,601,567,535,505,477,450,
9598 425,401,379,357,337,318,300,284,268,253,239,225,
9699 213,201,189,179,169,159,150,142,134,126,119,113,0,
100+
101+ // finetune +2
97102 844,796,752,709,670,632,597,563,532,502,474,447,
98103 422,398,376,355,335,316,298,282,266,251,237,224,
99104 211,199,188,177,167,158,149,141,133,125,118,112,0,
105+
106+ // finetune +3
100107 838,791,746,704,665,628,592,559,528,498,470,444,
101108 419,395,373,352,332,314,296,280,264,249,235,222,
102109 209,198,187,176,166,157,148,140,132,125,118,111,0,
110+
111+ // finetune +4
103112 832,785,741,699,660,623,588,555,524,495,467,441,
104113 416,392,370,350,330,312,294,278,262,247,233,220,
105114 208,196,185,175,165,156,147,139,131,124,117,110,0,
115+
116+ // finetune +5
106117 826,779,736,694,655,619,584,551,520,491,463,437,
107118 413,390,368,347,328,309,292,276,260,245,232,219,
108119 206,195,184,174,164,155,146,138,130,123,116,109,0,
120+
121+ // finetune +6
109122 820,774,730,689,651,614,580,547,516,487,460,434,
110123 410,387,365,345,325,307,290,274,258,244,230,217,
111124 205,193,183,172,163,154,145,137,129,122,115,109,0,
125+
126+ // finetune +7
112127 814,768,725,684,646,610,575,543,513,484,457,431,
113128 407,384,363,342,323,305,288,272,256,242,228,216,
114129 204,192,181,171,161,152,144,136,128,121,114,108,0,
130+
131+ // finetune -8
115132 907,856,808,762,720,678,640,604,570,538,508,480,
116133 453,428,404,381,360,339,320,302,285,269,254,240,
117134 226,214,202,190,180,170,160,151,143,135,127,120,0,
135+
136+ // finetune -7
118137 900,850,802,757,715,675,636,601,567,535,505,477,
119138 450,425,401,379,357,337,318,300,284,268,253,238,
120139 225,212,200,189,179,169,159,150,142,134,126,119,0,
140+
141+ // finetune -6
121142 894,844,796,752,709,670,632,597,563,532,502,474,
122143 447,422,398,376,355,335,316,298,282,266,251,237,
123144 223,211,199,188,177,167,158,149,141,133,125,118,0,
145+
146+ // finetune -5
124147 887,838,791,746,704,665,628,592,559,528,498,470,
125148 444,419,395,373,352,332,314,296,280,264,249,235,
126149 222,209,198,187,176,166,157,148,140,132,125,118,0,
150+
151+ // finetune -4
127152 881,832,785,741,699,660,623,588,555,524,494,467,
128153 441,416,392,370,350,330,312,294,278,262,247,233,
129154 220,208,196,185,175,165,156,147,139,131,123,117,0,
155+
156+ // finetune -3
130157 875,826,779,736,694,655,619,584,551,520,491,463,
131158 437,413,390,368,347,328,309,292,276,260,245,232,
132159 219,206,195,184,174,164,155,146,138,130,123,116,0,
160+
161+ // finetune -2
133162 868,820,774,730,689,651,614,580,547,516,487,460,
134163 434,410,387,365,345,325,307,290,274,258,244,230,
135164 217,205,193,183,172,163,154,145,137,129,122,115,0,
165+
166+ // finetune -1
136167 862,814,768,725,684,646,610,575,543,513,484,457,
137168 431,407,384,363,342,323,305,288,272,256,242,228,
138169 216,203,192,181,171,161,152,144,136,128,121,114,0,
139170
140− /* Arpeggio on -1 finetuned samples can do an overflown read from
141− ** the period table. Here's the correct overflow values from the
142− ** "CursorPosTable" and "UnshiftedKeymap" table, which are located
143− ** right after the period table. These tables and their order didn't
144− ** seem to change in the different PT1.x/PT2.x versions (I checked
145− ** the source codes).
146− ** PS: This is not a guess, these values *are* correct!
171+ /* Arpeggio on -1 finetuned samples can do an out-of-bounds read from
172+ ** this table. Here's the correct overflow values from the
173+ ** "CursorPosTable" and "UnshiftedKeymap" table in the PTcode, which are
174+ ** located right after the period table. These tables and their order didn't
175+ ** seem to change in the different PT1.x/PT2.x versions (I checked the
176+ ** source codes).
147177 */
148178 774,1800,2314,3087,4113,4627,5400,6426,6940,7713,
149179 8739,9253,24625,12851,13365

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t