[LAD] Wave shapes & forms

Philippe Coatmeur philcm at gnu.org
Tue Oct 21 13:56:23 UTC 2014


If this

     // calculate the next sample: phase ranges from 0 -> 1, but sin()
     // expects its input in radians. Just multiply by 2 PI to convert it!
     // We also multiply by volume so its not extremely loud.
     output[pos] = sin( self->phase * 2 * PI ) * volume;

Sends a sine wave to output (this is the standard sin 
<http://www.cplusplus.com/reference/cmath/sin/> math function, right?) 
then what would send a square wave? What would send noise?

Thanks -Phil

Philippe "xaccrocheur" Coatmeur
http://bitbucket.org/xaccrocheur / https://github.com/xaccrocheur

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20141021/9f63d8a7/attachment.html>

More information about the Linux-audio-dev mailing list