summaryrefslogtreecommitdiff
path: root/opcodes/mode.xml
blob: 3a687109074f0a4542c213f7c0a6ae4f1307647f (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
<refentry id="mode">
<indexterm id="IndexMode"><primary>mode</primary></indexterm>
  <refentryinfo><title>Signal Modifiers:Standard Filters</title></refentryinfo>
  <refmeta>
    <refentrytitle>mode</refentrytitle>
  </refmeta>

  <refnamediv>
    <refname>mode</refname>
    <refpurpose>
      A filter that simulates a mass-spring-damper system
    </refpurpose>
  </refnamediv>

  <refsect1>
    <title>Description</title>
    <para>
      Filters the incoming signal with the specified resonance frequency and
      quality factor. It can also be seen as a signal generator for high quality
      factor, with an impulse for the excitation. You can combine several modes
      to built complex instruments such as bells or guitar tables.
    </para>
  </refsect1>

  <refsect1>
    <title>Syntax</title>
    <synopsis>aout <command>mode</command> ain, xfreq, xQ [, iskip]</synopsis>
  </refsect1>

  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>iskip</emphasis>
      (optional, default=0) -- if non zero skip the initialisation of the
      filter.
    </para>
  </refsect1>

  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>aout</emphasis> -- filtered signal
    </para>

    <para>
      <emphasis>ain</emphasis> -- signal to filter
    </para>

    <para>
      <emphasis>xfreq</emphasis> -- resonant frequency of the filter
      <warning>
        <title>Warning</title>
        <para>
          This filter becomes unstable if <emphasis>sr</emphasis>/<emphasis>xfreq</emphasis> &lt;
          pi (e.g <emphasis>xfreq</emphasis> &gt; 14037 Hz @ 44 kHz)
        </para>
        </warning>
    </para>

    <para>
      <emphasis>xQ</emphasis> -- quality factor of the filter
    </para>

    <para>The resonance time is roughly proportional to <emphasis>xQ</emphasis>/<emphasis>xfreq</emphasis>.</para>

    <para>
      See <link linkend="MiscModalFreq"><citetitle>Modal Frequency Ratios</citetitle></link> for frequency ratios of real instruments which can be used to determine the values of <emphasis>xfreq</emphasis>.
    </para>
  </refsect1>

  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the mode opcode. It uses the file <ulink url="examples/mode.csd"><citetitle>mode.csd</citetitle></ulink>.
      <example>
        <title>Example of the mode 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/mode.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
      </example>
    </para>
  </refsect1>

  <refsect1>
    <title>Credits</title>
    <para>Original UDO and documentation/example by François Blanc</para>
    <para>Opcode translation to C-code by Steven Yi</para>
    <para>New in version 5.04</para>
    <para>Audio rate parameters introduced in version 6.02</para>
    <para>November 2013.</para>
   </refsect1>
</refentry>