function setup() {
  osc = new p5.TriOsc();
  osc.freq(260);
  createP('mousePressed: set amplitude to .7 over the course of .2 seconds');
  createP('mouseReleased: 1 second fade to 0. Start the fade 0.5 seconds from now');
}
Example: change amplitude with fadeTime, and schedule the change to happen in the future.