| 1 | |
| 2 | <refentry id="linen"> |
| 3 | <indexterm id="IndexLinen"><primary>linen</primary></indexterm> |
| 4 | <refentryinfo><title>Signal Generators:Envelope Generators</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>linen</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>linen</refname> |
| 11 | <refpurpose> |
| 12 | Applies a straight line rise and decay pattern to an input amp signal. |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | <emphasis>linen</emphasis> -- apply a straight line rise and decay pattern to an input amp signal. |
| 20 | </para> |
| 21 | </refsect1> |
| 22 | |
| 23 | <refsect1> |
| 24 | <title>Syntax</title> |
| 25 | <synopsis>ares <command>linen</command> xamp, irise, idur, idec</synopsis> |
| 26 | |
| 27 | <synopsis>kres <command>linen</command> kamp, irise, idur, idec</synopsis> |
| 28 | </refsect1> |
| 29 | |
| 30 | <refsect1> |
| 31 | <title>Initialization</title> |
| 32 | <para> |
| 33 | <emphasis>irise</emphasis> -- rise time in seconds. A zero or negative value signifies no rise modification. |
| 34 | </para> |
| 35 | |
| 36 | <para> |
| 37 | <emphasis>idur</emphasis> -- overall duration in seconds. A zero or negative value will cause initialization to be skipped. |
| 38 | </para> |
| 39 | |
| 40 | <para> |
| 41 | <emphasis>idec</emphasis> -- decay time in seconds. Zero means no decay. An <emphasis>idec</emphasis> > <emphasis>idur</emphasis> will cause a truncated decay. |
| 42 | </para> |
| 43 | </refsect1> |
| 44 | |
| 45 | <refsect1> |
| 46 | <title>Performance</title> |
| 47 | <para> |
| 48 | <emphasis>kamp, xamp</emphasis> -- input amplitude signal. |
| 49 | </para> |
| 50 | |
| 51 | <para> |
| 52 | Rise modifications are applied for the first <emphasis>irise</emphasis> seconds, and decay from time <emphasis>idur - idec</emphasis>. If these periods are separated in time there will be a steady state during which <emphasis>amp</emphasis> will be unmodified. If <emphasis>linen</emphasis> rise and decay periods overlap then both modifications will be in effect for that time. If the overall duration <emphasis>idur</emphasis> is exceeded in performance, the final decay will continue on in the same direction, going negative. |
| 53 | </para> |
| 54 | <para> |
| 55 | <mediaobject> |
| 56 | <imageobject> |
| 57 | <imagedata fileref="images/linen.jpg" format="JPG"/> |
| 58 | </imageobject> |
| 59 | <textobject> |
| 60 | <phrase>[Envelope generated by the linen opcode]</phrase> |
| 61 | </textobject> |
| 62 | <caption> |
| 63 | <para>Envelope generated by the <emphasis>linen</emphasis> opcode</para> |
| 64 | </caption> |
| 65 | </mediaobject> |
| 66 | </para> |
| 67 | <para> |
| 68 | <note> |
| 69 | <para>A common error with this opcode is to assume that the value of |
| 70 | 0 is the held after the envelope has finished at |
| 71 | <emphasis>idur</emphasis>. <emphasis>linen</emphasis> does not |
| 72 | automatically end or stop at the end of the duration given. |
| 73 | If your note length is longer than <emphasis>idur</emphasis> |
| 74 | seconds, <emphasis>kres</emphasis> (or <emphasis>ares</emphasis>) |
| 75 | will not come to rest at 0, but will instead continue to fall |
| 76 | with the same rate. If a decay and then hold is required then |
| 77 | the <link linkend="linseg"><citetitle>linseg</citetitle></link> opcode should be considered instead. |
| 78 | </para> |
| 79 | </note> |
| 80 | </para> |
| 81 | </refsect1> |
| 82 | |
| 83 | <refsect1> |
| 84 | <title>Examples</title> |
| 85 | <para> |
| 86 | Here is an example of the linen opcode. It uses the file <ulink url="examples/linen.csd"><citetitle>linen.csd</citetitle></ulink>. |
| 87 | |
| 88 | <example> |
| 89 | <title>Example of the linen opcode.</title> |
| 90 | <para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para> |
| 91 | <xi:include href="examples-xml/linen.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 92 | </example> |
| 93 | </para> |
| 94 | </refsect1> |
| 95 | |
| 96 | <refsect1> |
| 97 | <title>See Also</title> |
| 98 | <para> |
| 99 | <link linkend="SiggenEnvelope"><citetitle>Envelope Generators</citetitle></link> |
| 100 | </para> |
| 101 | </refsect1> |
| 102 | |
| 103 | </refentry> |