[LAD] Wave shapes & forms

From: Philippe Coatmeur <philcm@email-addr-hidden>
Date: Tue Oct 21 2014 - 16:56:23 EEST

Hi

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
http://opensimo.org/play/

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Tue Oct 21 20:15:01 2014

This archive was generated by hypermail 2.1.8 : Tue Oct 21 2014 - 20:15:01 EEST