summaryrefslogtreecommitdiff
path: root/opcodes/linen.xml
blob: 27503f511e4d92e49f538bcac30268b6b42c5d4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<refentry id="linen">
<indexterm id="IndexLinen"><primary>linen</primary></indexterm>
  <refentryinfo><title>Signal Generators:Envelope Generators</title></refentryinfo>
  <refmeta>
    <refentrytitle>linen</refentrytitle>
  </refmeta>

  <refnamediv>
    <refname>linen</refname>
    <refpurpose>
      Applies a straight line rise and decay pattern to an input amp signal.
    </refpurpose>
  </refnamediv>

  <refsect1>
    <title>Description</title>
    <para>
      <emphasis>linen</emphasis> -- apply a straight line rise and decay pattern to an input amp signal.
    </para>
  </refsect1>

  <refsect1>
    <title>Syntax</title>
    <synopsis>ares <command>linen</command> xamp, irise, idur, idec</synopsis>

    <synopsis>kres <command>linen</command> kamp, irise, idur, idec</synopsis>
 </refsect1>

  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>irise</emphasis> -- rise time in seconds. A zero or negative value signifies no rise modification.
    </para>

    <para>
      <emphasis>idur</emphasis> -- overall duration in seconds. A zero or negative value will cause initialization to be skipped.
    </para>

    <para>
      <emphasis>idec</emphasis> -- decay time in seconds. Zero means no decay. An <emphasis>idec</emphasis> &gt; <emphasis>idur</emphasis> will cause a truncated decay.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>kamp, xamp</emphasis> -- input amplitude signal.
    </para>

    <para>
      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.
    </para>
    <para>
      <mediaobject>
        <imageobject>
          <imagedata fileref="images/linen.jpg" format="JPG"/>
        </imageobject>
        <textobject>
          <phrase>[Envelope generated by the linen opcode]</phrase>
        </textobject>
        <caption>
          <para>Envelope generated by the <emphasis>linen</emphasis> opcode</para>
        </caption>
      </mediaobject>
    </para>
    <para>
      <note>
        <para>A common error with this opcode is to assume that the value of
          0 is the held after the envelope has finished at
          <emphasis>idur</emphasis>. <emphasis>linen</emphasis> does not
          automatically end or stop at the end of the duration given.
          If your note length is longer than <emphasis>idur</emphasis>
          seconds, <emphasis>kres</emphasis> (or <emphasis>ares</emphasis>)
          will not come to rest at 0, but will instead continue to fall
          with the same rate. If a decay and then hold is required then
          the <link linkend="linseg"><citetitle>linseg</citetitle></link> opcode should be considered instead.
        </para>
      </note>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the linen opcode. It uses the file <ulink url="examples/linen.csd"><citetitle>linen.csd</citetitle></ulink>.

      <example>
        <title>Example of the linen opcode.</title>
        <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>
          <xi:include href="examples-xml/linen.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
      </example>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="envlpx"><citetitle>envlpx</citetitle></link>,
      <link linkend="envlpxr"><citetitle>envlpxr</citetitle></link>,
      <link linkend="linenr"><citetitle>linenr</citetitle></link>
    </para>
  </refsect1>
</refentry>