[sdiy] Reverse Sawtooth
Steven Cook
stevenpaulcook at tiscali.co.uk
Tue Jan 25 11:43:21 CET 2011
> You can actually get away with 90 degrees of a sine wave table. 1/4 the
> space. It would eat more processor time and the code size MIGHT be worse
> than the table look up.
>
> Tim Daugard
You can get away with 45 degrees of a sine wave with even more fiddly code.
Or, you could combine sine and cosine tables. To get a 16-bit sine use 4
8-bit tables: a sine wave, a cosine wave, a 1/256th of a sine and a 1/256th
of a cosine. Pseudocode: (32-bit phase)
int x = phase >> 24;
int y = (phase >> 16) & 255;sine
= sinTable1[x]*cosTable2[y] + cosTable1[x]*sinTable2[y];
Regards,
Steven Cook,
http://www.spcplugins.com/
More information about the Synth-diy
mailing list