<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="GEN27">
  <refmeta>
    <refentrytitle>GEN27</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>GEN27</refname>
    <refpurpose>
      Construct functions from segments of straight lines in breakpoint fashion.
      <indexterm id="IndexGEN27"><primary>GEN27</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Construct functions from segments of straight lines in breakpoint fashion.
    </para>
  </refsect1>

  <refsect1>
    <title>Syntax</title>
    <synopsis><command>f</command> # time size 27 x1  y1 x2 y2 x3 ...</synopsis>
  </refsect1>

  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>size </emphasis> -- number of points in the table. Must be a power of 2 or power-of-2 plus 1 (see <link linkend="f"><citetitle>f statement</citetitle></link>).
    </para>

    <para>
      <emphasis>x1, x2, x3,</emphasis> etc. -- locations in table at which to attain the following y value. Must be in increasing order. If the last value is less than size, then the rest will be set to zero. Should not be negative but can be zero.
    </para>

    <para>
      <emphasis>y1, y2, y3,</emphasis>, etc. -- Breakpoint values attained at the location specified by the preceding x value.
    </para>

    <note>
      <title>Note</title>
      <para>
        If p4 is positive, functions are post-normalized (rescaled to a maximum absolute value of 1 after generation). A negative p4 will cause rescaling to be skipped.
      </para>
    </note>
  </refsect1>
 
  <refsect1>
    <title>Examples</title>
    <para>
      <informalexample>
        <programlisting>
<emphasis>f</emphasis> 1 0 257 27 0 0 100 1 200 -1 256 0
        </programlisting>
      </informalexample>

      This describes a function which begins at 0, rises to 1 at the 100th table location, falls to -1, by the 200th location, and returns to 0 by the end of the table. The interpolation is linear.
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="f"><citetitle>f statement</citetitle></link>,
      <link linkend="GEN25"><citetitle>GEN25</citetitle></link>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &namejohn;</member>
        <member>University of Bath/Codemist Ltd.</member>
        <member>Bath, UK</member>
      </simplelist>
    </para>

    <para>New in Csound version 3.49</para>
  </refsect1>
</refentry>
