static int GenerateSaw(int x, int oscLength) { if (oscLength == 0) return 0; return ((x * (65536 / oscLength)) >> 8) - 128; }