Parabolic shaper

notes
This function can be used for oscillators or shaper.
it can be driven by a phase accumulator or an audio input.
code
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
Function Parashape(inp:single):single;
var fgh,tgh:single;
begin
fgh    := inp ;
fgh    := 0.25-f_abs(fgh) ;
tgh    := fgh ;
tgh    := 1-2*f_abs(tgh);
fgh    := fgh*8;
result := fgh*tgh ;
end;
// f_abs is the function of ddsputils unit.