> I once needed a sine for > tone generation, but the provided sine function was > unnecessarily precise and therefore way to slow, so I had to > write my own table. > > Can you share your table please? >
When I said I "wrote", I was exaggerating a bit... I had used some online sine table generator, can't remember where I found it. I made a full sine wave in 256 steps, with values from -127 to 127. No additinal calculations, just one table lookup to get the sine value. And having 256 steps makes the function automatically wrap at the right point, so I can always add the same value to my (byte) counter variable, and when it "falls off" of the end of my single sine wave, it starts from the beginning to hit the exact right place. I can have a look for the actual code tomorrow. Greets, Kiste -- You received this message because you are subscribed to the Google Groups "jallib" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/jallib?hl=en.
