summaryrefslogtreecommitdiff
path: root/opcodes/cent.xml
blob: 861b54079ecf3b1e97b24779a2b91b7e88f46ee6 (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
<refentry id="cent">
<indexterm id="IndexCent"><primary>cent</primary></indexterm>
  <refentryinfo><title>Pitch Converters:Functions</title></refentryinfo>
  <refmeta>
    <refentrytitle>cent</refentrytitle>
  </refmeta>



  <refnamediv>
    <refname>cent</refname>
    <refpurpose>
      Calculates a factor to raise/lower a frequency by a given amount of cents.
    </refpurpose>
  </refnamediv>
  
  <refsect1>
    <title>Description</title>
    <para>
      Calculates a factor to raise/lower a frequency by a given amount of cents.
    </para>
  </refsect1>

  <refsect1>
    <title>Syntax</title>
    <synopsis><command>cent</command>(x) </synopsis>

    <para>
      This function works at a-rate, i-rate, and k-rate.
    </para>
  </refsect1>

  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>x</emphasis> -- a value expressed in cents.
    </para>
  </refsect1>

  <refsect1>
    <title>Performance</title>
    <para>
      The value returned by the <emphasis>cent</emphasis> function is a factor. You can multiply a frequency by this factor to raise/lower it by the given amount of cents.
    </para>
  </refsect1>

  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the cent opcode. It uses the file <ulink url="examples/cent.csd"><citetitle>cent.csd</citetitle></ulink>.

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

      Its output should include lines like:
      <screen>
instr 1:  iroot = 440.000
instr 1:  ifactor = 1.189
instr 1:  inew = 523.229</screen>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="db"><citetitle>db</citetitle></link>,
      <link linkend="octave"><citetitle>octave</citetitle></link>,
      <link linkend="semitone"><citetitle>semitone</citetitle></link>
    </para>
  </refsect1>

  <refsect1>
    <title>Credits</title>
    <para>Example written by &namekevin;.</para>
    <para>New in version 4.16</para>
  </refsect1>
</refentry>