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