It needs an short attack ramp, to eliminate the clicking. Or it can ensure that the waveform always start at the zero crossing.
https://github.com/mrcoles/javascript-piano/blob/master/audi...
Linear fade and quadratic fade sound nice on the way out, but all start at full volume.