<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="linsegr">
  <refmeta>
    <refentrytitle>linsegr</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>linsegr</refname>
    <refpurpose>
      Trace a series of line segments between specified points including a release segment.
      <indexterm id="IndexLinsegr"><primary>linsegr</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Trace a series of line segments between specified points including a release segment.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>ar <command>linsegr</command> ia, idur1, ib [, idur2] [, ic] [...], irel, iz</synopsis>

    <synopsis>kr <command>linsegr</command> ia, idur1, ib [, idur2] [, ic] [...], irel, iz</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>ia</emphasis> -- starting value. Zero is illegal for exponentials.
    </para>

    <para>
      <emphasis>ib, ic</emphasis>, etc. -- value after <emphasis>dur1</emphasis> seconds, etc. For exponentials, must be non-zero and must agree in sign with <emphasis>ia</emphasis>.
    </para>

    <para>
      <emphasis>idur1</emphasis> -- duration in seconds of first segment. A zero or negative value will cause all initialization to be skipped.
    </para>

    <para>
      <emphasis>idur2, idur3</emphasis>, etc. -- duration in seconds of subsequent segments. A zero or negative value will terminate the initialization process with the preceding point, permitting the last-defined line or curve to be continued indefinitely in performance. The default is zero.
    </para>

    <para>
      <emphasis>irel, iz</emphasis> -- duration in seconds and final value of a note releasing segment.
    </para>

    <para>
      Please note that the release time cannot be longer than 32767/<link linkend="kr"><citetitle>kr</citetitle></link> seconds.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      These units generate control or audio signals whose values can pass through 2 or more specified points. The sum of <emphasis>dur</emphasis> values may or may not equal the instrument's performance time: a shorter performance will truncate the specified pattern, while a longer one will cause the last-defined segment to continue on in the same direction.
    </para>

    <para>
      <emphasis>linsegr</emphasis> is amongst the Csound <quote>r</quote> units that contain a note-off sensor and release time extender. When each senses an event termination or MIDI noteoff, it immediately extends the performance time of the current instrument by <emphasis>irel </emphasis>seconds, and sets out to reach the value <emphasis>iz</emphasis> by the end of that period (no matter which segment the unit is in). <quote>r</quote> units can also be modified by MIDI noteoff velocities. For two or more extenders in an instrument, extension is by the greatest period.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the linsegr opcode. It uses the files <ulink url="examples/linsegr.orc"><citetitle>linsegr.orc</citetitle></ulink> and <ulink url="examples/linsegr.sco"><citetitle>linsegr.sco</citetitle></ulink>.

      <example>
        <title>Example of the linsegr opcode.</title>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/linsegr.orc" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/linsegr.sco" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>
      </example>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="expon"><citetitle>expon</citetitle></link>,
      <link linkend="expseg"><citetitle>expseg</citetitle></link>,
      <link linkend="expsegr"><citetitle>expsegr</citetitle></link>,
      <link linkend="line"><citetitle>line</citetitle></link>,
      <link linkend="linseg"><citetitle>linseg</citetitle></link>
    </para>
  </refsect1>

  <refsect1>
    <title>Credits</title>
    <para>Author: &namebarry;</para>
    <para>New in Csound 3.47</para>
    <para>December 2002. Thanks to &nameistvan;, added documentation about the maximum release time.</para>
  </refsect1>
</refentry>
