This can be done with a "diode breakpoint generator" like old HP function generators used to turn triangles into sine waves. Paul S.