function Noise(type) {
    var _this;
    noise_classCallCheck(this, Noise);
    _this = _super.call(this);
    var assignType;
    delete _this.f;
    delete _this.freq;
    delete _this.oscillator;
    if (type === 'brown') {
      assignType = _brownNoiseBuffer;
    } else if (type === 'pink') {
      assignType = _pinkNoiseBuffer;
    } else {
      assignType = _whiteNoiseBuffer;
    }
    _this.buffer = assignType;
    return _this;
  }
Noise is a type of oscillator that generates a buffer with random values.

 @class p5.Noise
 @extends p5.Oscillator
 @constructor
 @param {String} type Type of noise can be 'white' (default),
                      'brown' or 'pink'.
 @example
 <div><code>
 let noise,fft;
 let playing = false;

 function setup() {
   let cnv = createCanvas(100, 100);
   cnv.mousePressed(playNoise);
   cnv.mouseReleased(stopNoise);
   noStroke();
   fill(255,0,255);

   // Create a new p5.Noise object
   noise = new p5.Noise();
   // Create a new p5.FFT object
   fft = new p5.FFT();
 }

 function draw() {
   background(220);
   // Display the current type of noise or "Tap to play"
   textAlign(CENTER, CENTER);
   if (playing) {
     text('Noise type: '+noise.getType(), width / 2, 20);
   } else {
     text('Tap to play', width / 2, 20);
   }
   drawSpectrum();
 }

 function playNoise() {
   noise.start();
   playing = true;
 }

 function stopNoise() {
   noise.stop();
   playing = false;

   // Change the type of noise
   if (noise.getType() === 'white') {
     noise.setType('pink');
   } else if (noise.getType() === 'pink'){
     noise.setType('brown');
   } else {
     noise.setType('white');
   }
 }

 function drawSpectrum() {
   // Get and draw the frequency spectrum of the noise
   let spectrum = fft.analyze();
   beginShape();
   vertex(0, height);
   for (let i = 0; i < spectrum.length; i++) {
     let x = map(i, 0, spectrum.length, 0, width);
     let h = map(spectrum[i], 0, 255, height, 0);
     vertex(x, h);
   }
   vertex(width, height);
   endShape();
 }
 </code> </div>