knob("scale", {value: 10, circle: 200}); /* also supports step, min, max */ var tau = Math.PI*2; var sin = Math.sin; function dsp(t) { var sum = 0; for(var i = 0; i < midi.length; i++) { var freq = midi[i].freq; var vel = midi[i].vel; var z = (midi[i].t - t) * 5; sum += sin((freq+0.001*usin(freq*scale*t*tau))*t*tau) * 0.5 * vel * Math.exp(z); } return sum; } function usin(t) { return sin(t) * 0.5 + 0.5; }