sketch = function(p) {

  var actRandomSeed = 42;

  p.setup = function() {
    p.createCanvas(1024, 256);
  };

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

    // line
    p.stroke(0,130,164);
    p.strokeWeight(1);
    p.strokeJoin(p.ROUND);
    p.noFill();

    p.randomSeed(actRandomSeed);
    p.beginShape();
    for (var x = 0; x < p.width; x += 10) {
      var y = p.random(0,p.height);
      p.vertex(x,y);
    }
    p.endShape();

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

    p.randomSeed(actRandomSeed);
    for (var x = 0; x < p.width; x += 10) {
      var y = p.random(0,p.height);
      p.ellipse(x,y,3,3);
    }
  };

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

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

}
draws a random chart and shows how to use randomSeed.

MOUSE
click               : new random line

KEYS
s                   : save png