case 4: /* tone 2 : frequency */\r
R->Period[c] = R->UpdateStep * data;\r
if (R->Period[c] == 0) R->Period[c] = R->UpdateStep;\r
+ if (R->Count[c] > R->Period[c]) R->Count[c] = R->Period[c];\r
if (r == 4)\r
{\r
/* update noise shift frequency */\r
/* and vol[i] incremented only if the exit status of the square */\r
/* wave is 1. */\r
if (R->Count[i] < -2*R->Period[i] || R->Volume[i] == 0) {\r
- /* Cut of anything above the Nyquist freqency */\r
- /* It will only create aliasing anyway */\r
+ /* Cut off anything above the Nyquist frequency. */\r
+ /* It will only create aliasing anyway. This is actually an */\r
+ /* ideal lowpass filter with Nyquist corner frequency. */\r
vol[i] += STEP/2; // mean value\r
R->Count[i] = R->Output[i] = 0;\r
}\r