summaryrefslogtreecommitdiff
path: root/scoregens/gen06.xml
blob: aef0a8cb26563c1e01d5f449233366309f9410cf (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
<refentry id="GEN06">
      <indexterm id="IndexGEN06"><primary>GEN06</primary></indexterm>
  <refmeta>
    <refentrytitle>GEN06</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>GEN06</refname>
    <refpurpose>
      Generates a function comprised of segments of cubic polynomials.
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      This subroutine will generate a function comprised of segments of cubic polynomials, spanning specified points just three at a time.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis><command>f</command>  #   time   size   6   a   n1   b   n2   c   n3   d ...</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>size</emphasis> -- number of points in the table. Must be a power off or power-of-2 plus 1 (see <link linkend="f"><citetitle>f statement</citetitle></link>).
    </para>

    <para>
      <emphasis>a, c, e, ...</emphasis> -- local maxima or minima of successive segments, depending on the relation of these points to adjacent inflexions. May be either positive or negative.
    </para>

    <para>
      <emphasis>b, d, f, ...</emphasis> -- ordinate values of points of inflexion at the ends of successive curved segments. May be positive or negative.
    </para>

    <para>
      <emphasis>n1, n2, n3 ...</emphasis> -- number of stored values between specified points. Cannot be negative, but a zero is meaningful for specifying discontinuities. The sum <emphasis>n1</emphasis> + <emphasis>n2</emphasis> + ... will normally equal size for fully specified functions. (for details, see <link linkend="GEN05"><citetitle>GEN05</citetitle></link>).
    </para>

    <note>
      <title>Note</title>
      <para>
        <emphasis>GEN06</emphasis> constructs a stored function from segments of cubic polynomial functions. Segments link ordinate values in groups of 3: point of inflexion, maximum/minimum, point of inflexion. The first complete segment encompasses <emphasis>b</emphasis>, <emphasis>c</emphasis>, <emphasis>d</emphasis> and has length <emphasis>n2</emphasis> + <emphasis>n3</emphasis>, the next encompasses <emphasis>d</emphasis>, <emphasis>e</emphasis>, <emphasis>f</emphasis> and has length <emphasis>n4</emphasis> + <emphasis>n5</emphasis>, etc. The first segment (<emphasis>a</emphasis>, <emphasis>b</emphasis> with length <emphasis>n1</emphasis>) is partial with only one inflexion; the last segment may be partial too. Although the inflexion points <emphasis>b</emphasis>, <emphasis>d</emphasis>, <emphasis>f</emphasis> ... each figure in two segments (to the left and right), the slope of the two segments remains independent at that common point (i.e. the 1st derivative will likely be discontinuous). When <emphasis>a</emphasis>, <emphasis>c</emphasis>, <emphasis>e</emphasis>... are alternately maximum and minimum, the inflexion joins will be relatively smooth; for successive maxima or successive minima the inflexions will be comb-like.
      </para>
    </note>
  </refsect1>
 
  <refsect1>
    <title>Examples</title>
    <para>
      Here is a simple example of the GEN06 routine. It uses the files <ulink url="examples/gen06.csd"><citetitle>gen06.csd</citetitle></ulink>. It creates a curve running 0 to 1 to -1, with a minimum, maximum and minimum at these values respectively. Inflexions are at .5 and 0 and are relatively smooth. Here is its diagram:

      <mediaobject>
        <imageobject>
          <imagedata fileref="images/gen06.png" format="PNG"/>
        </imageobject>

        <textobject>
          <phrase>Diagram of the waveform generated by GEN06.</phrase>
        </textobject>

        <caption>
          <para>Diagram of the waveform generated by GEN06.</para>
        </caption>
      </mediaobject>

      <example>
        <title>A simple example of the GEN06 routine.</title>

        <xi:include href="examples-xml/gen06.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
      </example>
    </para>
  </refsect1>

  <refsect1>
     <title>See Also</title>
     <para>
       <link linkend="GEN05"><citetitle>GEN05</citetitle></link>,
       <link linkend="GEN07"><citetitle>GEN07</citetitle></link>, and
       <link linkend="GEN08"><citetitle>GEN08</citetitle></link>
     </para>
  </refsect1>
</refentry>