function setup() {
  createCanvas(windowWidth, windowHeight);
  fft = new p5.FFT(0, 256);


  env = new p5.Envelope();
  env.setADSR(0.01, 0.2, 0.1, 0.3);
  env.setRange(1.0, 0.0);

  osc = new p5.SawOsc(); // connects to main output by default
  osc.start(0);
  osc.freq(220);
  osc.amp(env);
  osc.disconnect(); // Disconnect from output to process through distortion

  // Create a waveshaper distortion with 2x oversampling
  distortion = new p5.Distortion(1, '4x');
  osc.connect(distortion);
}
Trigger an oscillator processed through distortion.