HREF="node70.html">Transfer functions for amplitude</A>
<B> Up:</B><ANAME="tex2html1571"
HREF="node68.html">Examples</A>
<B> Previous:</B><ANAME="tex2html1565"
HREF="node68.html">Examples</A>
<B><ANAME="tex2html1573"
HREF="node4.html">Contents</A></B>
<B><ANAME="tex2html1575"
HREF="node201.html">Index</A></B>
<BR>
<BR>
<!--End of Navigation Panel-->
<H2><ANAME="SECTION00881000000000000000">
ADSR envelope generator</A>
</H2>
<P>
Example D01.envelope.gen.pd (Figure <AHREF="#fig04.12">4.12</A>) shows how the <TT>line~</TT> object may
be used to generate an ADSR envelope to control a synthesis patch (only the
ADSR envelope is shown in the figure). The ``attack" button, when pressed, has
two effects. The first (leftmost in the figure) is to set the <TT>line~</TT> object on its attack segment, with a target of 10 (the peak amplitude) over 200
msec (the attack time). Second, the attack button sets a <TT>delay 200</TT> object, so that after the attack segment is done, the decay segment can start.
The decay segment falls to a target of 1 (the sustain level) after another 2500
In this example the five creation arguments (1, 100, 200, 50, and 300) specify
the peak level, attack time, decay time, sustain level (as a percentage of peak
level), and release time. There are six control inlets: the first to trigger
the ADSR generator, and the others to update the values of the five parameters.
The output of the abstraction is an audio signal.
<P>
This abstraction is realized as shown in Figure <AHREF="#fig04.14">4.14</A>. (You can open
this subpatch by clicking on the <TT>adsr</TT> object in the patch.) The only
signal objects are <TT>line~</TT> and <TT>outlet~</TT>. The three <TT>pack</TT> objects correspond to the three message objects from the earlier Figure
<AHREF="#fig04.12">4.12</A>. From left to right, they take care of the attack, decay,