waveform (square, sin, saw, etc.)

Another of my simple questions.

How to generate cyclic values which have sinus shapes, squares shapes ? but not as sound signals but just float values ?

Have someone an idea or an addon to advice about it ?

Thx in advance.

there are a number of waveform libraries out there: if you just want a quick ready made solution a google search will do the trick :slight_smile:

on the other hand making waveforms on your own is really easy; something like this will do the trick:

float samples[nSamples];  
for(int i=0; i<nSamples;i++){  
   float a = TWO_PI/nSamples*i;  
   //sine wave  
   //square wave  
   //saw wave