Section <AHREF="node60.html#sect4.curved">4.2</A> described using ADSR envelopes to control
amplitude, for which exponential or quartic-curve segments often give more
natural-sounding results than linear ones. Patches D03.envelope.dB.pd and D04.envelope.quartic.pd (the latter shown in Figure <AHREF="#fig04.15">4.15</A>)
demonstrate the use of decibel and quartic segments. In addition to amplitude,
in Example D04.envelope.quartic.pd the frequency of a sound is also controlled, using linear
Since converting decibels to linear amplitude units is a costly operation
(at least when compared to an oscillator or a ramp generator), Example D03.envelope.dB.pd uses table lookup to implement the necessary transfer function. This has the
advantage of efficiency, but the disadvantage that we must decide on the
range of admissible values in advance (here from 0 to 120 dB).
<P>
For a
quartic segment as in Example D04.envelope.quartic.pd no table lookup is required;
we simply square the <TT>line~</TT> object's output signal twice in succession.
To compensate for raising the output to the fourth power, the target values
sent to the <TT>line~</TT> object must be the fourth root of the desired
ones. Thus, messages to ramp the frequency or amplitude are first unpacked to
separate the target and time interval, the target's fourth root is taken
(via two square roots in succession), and the two are then sent to the
<TT>line~</TT> object. Here we have made use of one new Pd object:
<P>
<BR><!-- MATH
$\fbox{ $\mathrm{unpack}$}$
-->
<IMG
WIDTH="69" HEIGHT="41" ALIGN="MIDDLE" BORDER="0"
SRC="img383.png"
ALT="\fbox{ $\mathrm{unpack}$}">:
<ANAME="4907"></A>unpack a list of numbers (and/or symbols) and distribute them to separate
outlets. As usual the outputs appear in right-to-left order. The number of
outlets and their types are determined by the creation arguments. (See also