summaryrefslogtreecommitdiff
path: root/scoregens/gen20.xml
blob: 9e1319558b9c92205991d7bb295ffa113aca7e7f (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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<refentry id="GEN20">
      <indexterm id="IndexGEN20"><primary>GEN20</primary></indexterm>
  <refmeta>
    <refentrytitle>GEN20</refentrytitle>
  </refmeta>

  <refnamediv>
    <refname>GEN20</refname>
    <refpurpose>
      Generates functions of different windows.
    </refpurpose>
  </refnamediv>

  <refsect1>
    <title>Description</title>
    <para>
      This subroutine generates functions of different windows. These windows are usually used for spectrum analysis or for grain envelopes.
    </para>
  </refsect1>

  <refsect1>
    <title>Syntax</title>
    <synopsis><command>f</command> # time size 20 window max [opt]</synopsis>
  </refsect1>

  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>size</emphasis> -- number of points in the table. Must be a power of 2 ( + 1).
    </para>

    <para>
      <emphasis>window</emphasis> -- Type of window to generate:

      <itemizedlist>
        <listitem>
          <para>1 = Hamming</para>
        </listitem>
        <listitem>
          <para>2 = Hanning</para>
        </listitem>
        <listitem>
          <para>3 = Bartlett ( triangle)</para>
        </listitem>
        <listitem>
          <para>4 = Blackman ( 3-term)</para>
        </listitem>
        <listitem>
          <para>5 = Blackman - Harris ( 4-term)</para>
        </listitem>
        <listitem>
          <para>6 = Gaussian</para>
        </listitem>
        <listitem>
          <para>7 = Kaiser</para>
        </listitem>
        <listitem>
          <para>8 = Rectangle</para>
        </listitem>
        <listitem>
          <para>9 = Sync</para>
        </listitem>
      </itemizedlist>
    </para>

    <para>
      <emphasis>max</emphasis> -- For negative p4 this will be the absolute 
      value at window peak point. If p4 is positive or p4 is negative
      and p6 is missing the table will be post-rescaled to a maximum
      value of 1. 
    </para>

    <para>
      <emphasis>opt</emphasis> -- Optional argument required by the 
      Gaussian window and the Kaiser window.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Examples</title>
    <para>
      <informalexample>
        <programlisting>
<emphasis role="stamnt">f</emphasis>       1       0       1024    20      5</programlisting>
      </informalexample>

      This creates a function which contains a 4 - term Blackman - Harris window with maximum value of 1.
    </para>

    <para>
      <informalexample>
        <programlisting>
<emphasis role="stamnt">f</emphasis>       1       0       1024    -20     2       456</programlisting>
      </informalexample>

      This creates a function that contains a Hanning window with a maximum value of 456.
    </para>

    <para>
      <informalexample>
        <programlisting>
<emphasis role="stamnt">f</emphasis>       1       0       1024    -20     1</programlisting>
      </informalexample>

      This creates a function that contains a Hamming window with a maximum value of 1.
    </para>

    <para>
      <informalexample>
        <programlisting>
<emphasis role="stamnt">f</emphasis>       1       0       1024    20      7       1       2</programlisting>
      </informalexample>

      This creates a function that contains a Kaiser window with a maximum value of 1. The extra argument specifies how &quot;open&quot; the window is, for example a value of 0 results in a rectangular window and a value of 10 in a Hamming like window.
    </para>

    <para>
      <informalexample>
        <programlisting>
<emphasis role="stamnt">f</emphasis>       1       0       1024    20      6       1       2</programlisting>
      </informalexample>

      This creates a function that contains a Gaussian window with a
      maximum value of 1.  The extra argument specifies how broad the
      window is, as the standard deviation of the curve; in this
      example the s.d. is 2.  The default value is 1.
    </para>
    <para>
      For all diagrams, see <link linkend="MiscWindows"><citetitle>Window Functions</citetitle></link>
    </para>

    <para>
      Here is an example of the GEN20 routine. It uses the file <ulink url="examples/gen20.csd"><citetitle>gen20.csd</citetitle></ulink>.

           <example>
        <title>Example of the GEN20 routine.</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/gen20.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
      </example>  
        <textobject>
          <phrase>These are the diagrams of the waveforms of the GEN20 routines, as used in the example:</phrase>
        </textobject>

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

        <textobject>
          <phrase>  f 1  0 512 20 2 - Hanning window</phrase>
        </textobject>


        <caption>
          <para>  f 1  0 512 20 2 - Hanning window</para>
        </caption>
      </mediaobject>

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

        <textobject>
          <phrase>  f 2  0 512 20 6 1 - Gaussian window</phrase>
        </textobject>

        <caption>
          <para>  f 2  0 512 20 6 1 - Gaussian window</para>
        </caption>
      </mediaobject>
   
    </para>
  </refsect1>

  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &nameparis;</member>
        <member>MIT, Cambridge</member>
        <member>1995</member>
      </simplelist>
    </para>

    <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.2</para>
    <para>Optional argument to Gaussian added in 5.10</para>
  </refsect1>
</refentry>