Debian Codegraph @

opcodes/cpstun.xml

raw symbols SCIP
1
2 <refentry id="cpstun">
3 <indexterm id="IndexCpstun"><primary>cpstun</primary></indexterm>
4 <refentryinfo><title>Pitch Converters:Tuning Opcodes</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>cpstun</refentrytitle>
7 </refmeta>
8
9
10
11 <refnamediv>
12 <refname>cpstun</refname>
13 <refpurpose>
14 Returns micro-tuning values at k-rate.
15 </refpurpose>
16 </refnamediv>
17
18 <refsect1>
19 <title>Description</title>
20 <para>
21 Returns micro-tuning values at k-rate.
22 </para>
23 </refsect1>
24
25 <refsect1>
26 <title>Syntax</title>
27 <synopsis>kcps <command>cpstun</command> ktrig, kindex, kfn</synopsis>
28 </refsect1>
29
30 <refsect1>
31 <title>Performance</title>
32 <para>
33 <emphasis>kcps</emphasis> -- Return value in cycles per second.
34 </para>
35
36 <para>
37 <emphasis>ktrig</emphasis> -- A trigger signal used to trigger the evaluation.
38 </para>
39
40 <para>
41 <emphasis>kindex</emphasis> -- An integer number denoting an index of scale.
42 </para>
43
44 <para>
45 <emphasis>kfn</emphasis> -- Function table containing the parameters (numgrades, interval, basefreq, basekeymidi) and the tuning ratios.
46 </para>
47
48 <para>
49 These opcodes are similar to <link linkend="cpstmid"><citetitle>cpstmid</citetitle></link>, but work without necessity of MIDI.
50 </para>
51
52 <para>
53 <emphasis>cpstun</emphasis> works at k-rate. It allows fully customized micro-tuning scales. It requires a function table number containing the tuning ratios, and some other parameters stored in the function table itself.
54 </para>
55
56 <para>
57 <emphasis>kindex</emphasis> arguments should be filled with integer numbers expressing the grade of given scale to be converted in cps. In <emphasis>cpstun</emphasis>, a new value is evaluated only when <emphasis>ktrig</emphasis> contains a non-zero value. The function table <emphasis>kfn</emphasis> should be generated by <link linkend="GEN02"><citetitle>GEN02</citetitle></link> and the first four values stored in this function are parameters that express:
58 <itemizedlist>
59 <listitem><para>numgrades -- The number of grades of the micro-tuning scale.</para></listitem>
60
61 <listitem><para>interval -- The frequency range covered before repeating the grade ratios, for example 2 for one octave, 1.5 for a fifth etcetera.</para></listitem>
62
63 <listitem><para>basefreq -- The base frequency of the scale in cycles per second.</para></listitem>
64
65 <listitem><para>basekey -- The integer index of the scale to which to assign basefreq unmodified.</para></listitem>
66 </itemizedlist>
67 </para>
68
69 <para>
70 After these four values, the user can begin to insert the tuning ratios. For example, for a standard 12-grade scale with the base-frequency of 261 cps assigned to the key-number 60, the corresponding f-statement in the score to generate the table should be:
71
72 <informalexample>
73 <programlisting>
74 <emphasis role="comment">; numgrades basefreq tuning-ratios (eq.temp) .......</emphasis>
75 <emphasis role="comment">; interval basekey</emphasis>
76 <emphasis role="stamnt">f</emphasis>1 0 64 -2 12 2 261 60 1 1.059463 1.12246 1.18920 ..etc...</programlisting>
77 </informalexample>
78 </para>
79
80 <para>
81 Another example with a 24-grade scale with a base frequency of 440 assigned
82 to the key-number 48, and a repetition interval of 1.5:
83
84 <informalexample>
85 <programlisting>
86 <emphasis role="comment">; numgrades basefreq tuning-ratios .......</emphasis>
87 <emphasis role="comment">; interval basekey</emphasis>
88 <emphasis role="stamnt">f</emphasis>1 0 64 -2 24 1.5 440 48 1 1.01 1.02 1.03 ..etc...</programlisting>
89 </informalexample>
90 </para>
91 </refsect1>
92
93 <refsect1>
94 <title>Examples</title>
95 <para>
96 Here is an example of the cpstun opcode. It uses the file <ulink url="examples/cpstun.csd"><citetitle>cpstun.csd</citetitle></ulink>.
97
98 <example>
99 <title>Example of the cpstun opcode.</title>
100
101
102
103 <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>
104 <xi:include href="examples-xml/cpstun.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
105 </example>
106
107 Its output should include lines like this:
108 <screen>i1 440.11044</screen>
109 </para>
110 </refsect1>
111
112 <refsect1>
113 <title>See also</title>
114 <para><link linkend="PitchTuning"><citetitle>Pitch Converters: Tuning Opcodes</citetitle></link></para>
115 </refsect1>
116
117 <refsect1>
118 <title>Credits</title>
119 <para>Example written by &namekevin;.</para>
120 </refsect1>
121 </refentry>