summaryrefslogtreecommitdiff
path: root/opcodes/oscili.xml
blob: f8c3246a1e66cfd5bfc69300501a8b3d08ea2189 (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
<refentry id="oscili">
<indexterm id="IndexOscili"><primary>oscili</primary></indexterm>
  <refentryinfo><title>Signal Generators:Basic Oscillators</title></refentryinfo>
  <refmeta>
    <refentrytitle>oscili</refentrytitle>
  </refmeta>


 
  <refnamediv>
    <refname>oscili</refname>
    <refpurpose>
      A simple oscillator with linear interpolation.
          </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Table <emphasis>ifn</emphasis> is incrementally sampled modulo the table length and the value obtained is multiplied by <emphasis>amp</emphasis>.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>ares <command>oscili</command> xamp, xcps, ifn [, iphs]</synopsis>

    <synopsis>kres <command>oscili</command> kamp, kcps, ifn [, iphs]</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>ifn</emphasis> -- function table number. Requires a wrap-around guard point.
    </para>

    <para>
      <emphasis>iphs</emphasis> (optional) -- initial phase of sampling, expressed as a fraction of a cycle (0 to 1). A negative value will cause phase initialization to be skipped. The default value is 0.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>kamp, xamp</emphasis> -- amplitude
    </para>

    <para>
      <emphasis>kcps, xcps</emphasis> -- frequency in cycles per second.
    </para>

    <para>
      <emphasis>oscili</emphasis> differs from <link linkend="oscil"><citetitle>oscil</citetitle></link> in that the standard procedure of using a truncated phase as a sampling index is here replaced by a process that interpolates between two successive lookups. Interpolating generators will produce a noticeably cleaner output signal, but they may take as much as twice as long to run. Adequate accuracy can also be gained without the time cost of interpolation by using large stored function tables of 2K, 4K or 8K points if the space is available.
    </para>
 </refsect1>
 
  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the oscili opcode. It uses the file <ulink url="examples/oscili.csd"><citetitle>oscili.csd</citetitle></ulink>.

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

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="oscil"><citetitle>oscil</citetitle></link>,
      <link linkend="oscil3"><citetitle>oscil3</citetitle></link>
    </para>
  </refsect1>

  <refsect1>
    <title>Credits</title>
    <para>Example written by &namekevin;.</para>
  </refsect1>
</refentry>