As you can see (and hear), random() as used in this "noisy" demo gives an amplitude modulated "semi-percussive" sound effect, while sin() as used in
twobob's "tones" demo gives pure unmodulated sine wave tones.
The question still stands though: If sin() gives sine wave tones, would replacing it with (x*x) give "square wave" tones?
(That's a "waveform" joke, folks!)