How it works:
An envelope contains an array of {duration,value} pairs called segments.
These segments describe a contour or shape that can be used to control
other unit generators. In this example, the envelope is connected
to the Amplitude of an oscillator. Portions of an envelope can be
queued up for playback. Note that the Synth.FLAG_AUTO_STOP is used to stop
the envelope execution when the last segment finishes. This reduces
the CPU utilization which can be seen by clicking on the "Usage" button
before and after the envelope finishes.