here we go step by step through the basic construction of an ADSR envelope, looking at some functions of line, line~ and vline~ along the way.

http://www.pdpatchrepo.info/hurleur/diy-envelope-tutorial.pd