I need a way to display a saw waveform that morphs into a triangle based on a x & y equation. i've managed to write something that will display 1 wavecycle but i need something that will fill the paintbox with a series of waves.
for x := 1 to Paintbox.Width do
rx := ( ( 1 / Paintbox.Width ) * x );
GraphIt( rx, ry );
y := Round( ( 1 - (ry/1) ) * Paintbox.Height);
if x = 1 then
Paintbox.Canvas.MoveTo( x, y )
Paintbox.Canvas.LineTo( x, y );
procedure GraphIt(X: Real; var Y: Real);
// As shape increases, the wave gets steeper. Sawtooth has
// slope 1, increasing to slope 2 for triangle.
slope := (PatBuf[oDCO1_WAVESHAPE] + 63.0) / 63.0;
tmp := round(X / slope);
Y := (X - (tmp * slope) ) * slope;
// But output > 1 gets folded back.
if Y > 0.5 then Y := 1 - Y;
any help would be much appreciated...