On Thu, 8 Apr 2004 18:09:03 -0400, "Sergei Gerasenko"
<[EMAIL PROTECTED]> wrote:

>I knew there was something wrong with that method. Thanks for this info.
>I think I'll go with my own synthesis. I'm in no hurry :)

OK, then try constructing your synthesis function based on
instantaneous phase.  For each sound sample (11025 or 22050 samples
per second) do this:

phase = phase + offset
if(phase >= 360)  phase -= 360;
sample[i] = <some formula based on phase, maybe a lookup table>
i++;

When "i" reaches the end of the current buffer, start another buffer,
but don't reset phase.  It should be continuous across buffer
boundaries.  By the way, the code shown above will have to be
optimized for speed.  You probably won't be able to keep up in
real-time if you use floating point.  You could express phase and
offset as a 16-bit or 32-bit integer with an assumed binary point
somewhere in there.  Where you put the binary point depends on your
need for frequency resolution and range.  For example, if phase is

  .xxxxxxxx xxxxxxxx

and if your sample rate is 11025 samples per second, then you can
express frequencies as high as nearly 11025 Hz with a resolution of
0.168 Hz.  Offset is like frequency.  Good luck.



Robert Scott, Ypsilanti, MI
(reply through this forum, not by e-mailing me directly)

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to