Hello Winni.
Wow, superb, I take it (if you agree).
About the wave formula.
Here the sine wave formula:
case WaveType of
0: begin
for I := 0 to 359 do
SA[I] := round(sin(pi * I / 180.0) * volume); // create sine wave pattern
end;
So it begins from sin(0) = 0
then pass to sin(90) = 1
then pass to sin(180) = 0
then pass to sin(270) =-1
And finally to sin(360) = 0
So the cycle begins from 0 to end to 0.
But with the saw tooth wave:
2: begin
for I := 0 to 359 do
SA[i] := (round((360 - i)/180) -1)*volume; // saw tooth wave
end;
end;
It begins with 1 then end to -1,
So, imho, only a half cycle.
Should it not be something like this ?:
2: begin
for I := 0 to 359 do
if i < 180 then
SA[i] := (round((360 - (i*2))/180) -1)*volume // saw tooth wave
else SA[i] := SA[359-i];
end;
end;
Fre;D