sketch = function(p) {

  p.setup = function() {
    p.createCanvas(1024,256);
    p.strokeWeight(1);
    p.strokeJoin(p.ROUND);
  };

  p.draw = function() {
    p.background(255);

    // line
    p.stroke(0,130,164);
    p.noFill();

    var noiseXRange = p.mouseX / 10;
    console.log('noiseXRange: 0 - ' + noiseXRange);

    p.beginShape();
    for (var x = 0; x < p.width; x += 10) {
      var noiseX = p.map(x, 0, p.width, 0, noiseXRange);
      var y = p.noise(noiseX) * p.height;
      p.vertex(x,y);
    };
    p.endShape();

    // dots
    p.noStroke();
    p.fill(0);

    for (var x = 0; x < p.width; x += 10) {
      var noiseX = p.map(x, 0, p.width, 0, noiseXRange);
      var y = p.noise(noiseX) * p.height;
      p.ellipse(x,y,3,3);
    }
  };

  p.mousePressed = function() {
    p.noiseSeed(p.random(100000));
  };

  p.keyReleased = function(){
    if (p.key == 's' || p.key == 'S') p.saveCanvas(gd.timestamp(), 'png');
  };

}
draws a chart based on noise values.

MOUSE
position x          : specify noise input range
click               : new noise line

KEYS
s                   : save png