title: Recursive audio solution
body: <p>I just want to get my head wrapped around recursion using something simple. I want amplitudes from 1 to -1. This will take less than two minutes. </p>
  
  <p>I just through together a recursive solution to practice recursing. </p>
  
  <pre><code>/* This program outputs amplitudes within a frequency of 440Hz. 
     The number of audio samples will add of up to 1024, and the highest frequency 
     We can generate is about 20KilHz. 
  */
  #include&lt;stdio.h&gt;  
  #include&lt;math.h&gt; 
  #define PI 3.141597 
  #define TwoPI (2*3.141597) 
  #define SampleRate 441000
  #define Frequency 440 
  #define Buffer 1024
  /* Recursively Generates Signal, it is called in main. */ 
  /*int CalculateSignal(int Sampler){
      Sampler=0; 
      int Sample= 0; 
      Sample=sin(Frequency*TwoPI*SampleRate);
  
      printf("%.6f",Sample);
  
      if(Sampler==Buffer){
  
          return Sample; 
      }
  
      else if(Sampler&lt;Buffer){
          return CalculateSignal(Sampler+1);
      }
  }*/
  int main(){
  
      CalculateSignal(1024);
  
  }
  </code></pre>