I invite all fans of electronic music and programming, to play in the synthesis of melodies using Code Music Studio . The bottom line is as follows: You need to create a function that takes an argument time, and returns an amplitude in the range from -1 to 1, for example:
var n = 0; returnfunction (t) { var x = Math.sin(t * 256 + Math.sin(n)); n += Math.sin(t); return x; }