Redesigned sound generation for smoother sine wave