Debian Codegraph @

opcodes/readk2.xml

raw symbols SCIP
1
2 <refentry id="readk2">
3 <indexterm id="IndexReadk2"><primary>readk2</primary></indexterm>
4 <refentryinfo><title>Signal I/O:File I/O</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>readk2</refentrytitle>
7 </refmeta>
8
9 <refnamediv>
10 <refname>readk2</refname>
11 <refpurpose>
12 Periodically reads two orchestra control-signal values from an external file.
13 </refpurpose>
14 </refnamediv>
15
16 <refsect1>
17 <title>Description</title>
18 <para>
19 Periodically reads two orchestra control-signal values from an external file.
20 </para>
21 </refsect1>
22
23 <refsect1>
24 <title>Syntax</title>
25 <synopsis>kr1, kr2 <command>readk2</command> ifilname, iformat, iprd</synopsis>
26 </refsect1>
27
28 <refsect1>
29 <title>Initialization</title>
30 <para>
31 <emphasis>ifilname</emphasis> -- an integer N denoting a file named "readk.N" or a character string (in double quotes, spaces permitted) denoting the external file name. For a string, it may either be a full path name with directory specified or a simple filename. In the later case, the file is sought first in the current directory, then in <link linkend="CommandEnvironment"><citetitle>SSDIR</citetitle></link>, and finally in <link linkend="CommandEnvironment"><citetitle>SFDIR</citetitle></link>.
32 </para>
33
34 <para>
35 <emphasis>iformat</emphasis> -- specifies the input data format:
36 <itemizedlist>
37 <listitem>
38 <para>1 = 8-bit signed integers (char)</para>
39 </listitem>
40
41 <listitem>
42 <para>4 = 16-bit short integers</para>
43 </listitem>
44
45 <listitem>
46 <para>5 = 32-bit long integers</para>
47 </listitem>
48
49 <listitem>
50 <para>6 = 32-bit floats</para>
51 </listitem>
52
53 <listitem>
54 <para>7 = ASCII long integers (plain text)</para>
55 </listitem>
56
57 <listitem>
58 <para>8 = ASCII floats (plain text)</para>
59 </listitem>
60 </itemizedlist>
61 </para>
62
63 <para>
64 Note that A-law and U-law formats are not available, and that all formats except the last two are binary. The input file should be a "raw", headerless data file.
65 </para>
66
67 <para>
68 <emphasis>iprd</emphasis> -- the rate (period) in seconds, rounded to the nearest orchestra control period, at which the signals are read from the input file. A value of 0 implies one control period (the enforced minimum), which will read new values at the orchestra control rate. Longer periods will cause the same values to repeat for more than one control period.
69 <!--unless interpolation is used.-->
70 </para>
71
72
73 <!-- <para>
74 <emphasis>interp</emphasis> - (optional) interpolate between values.
75 </para>-->
76 <!--
77 <para>
78 <emphasis>ipol</emphasis> - if non-zero, and <emphasis>iprd</emphasis> implies more than one control period, interpolate the k- signals between the periodic reads from the external file. If the value is 0, repeat each signal between frames. Currently not supported.
79 </para>-->
80 </refsect1>
81
82 <refsect1>
83 <title>Performance</title>
84 <para>
85 <emphasis>kr1, kr2</emphasis> -- output of the signals read from <emphasis>ifilname</emphasis>.
86 </para>
87
88 <para>
89 This opcode allows two generated control signal values to be read from a named external file. The file should contain no header information but it should contain a regularly sampled time series of control values. For binary formats, the individual samples of each signal are interleaved. For ASCII text formats, the values are assumed to be separated by at least one whitespace character. The two "channels" in a sample frame may be on the same line or separated by newline characters, it does not matter. There may be any number of <emphasis>readk2</emphasis> opcodes in an instrument or orchestra and they may read from the same or different files.
90 </para>
91 </refsect1>
92
93 <refsect1>
94 <title>Examples</title>
95 <para>
96 Here is an example of the readk2 opcode. It uses the file <ulink url="examples/readk2.csd"><citetitle>readk2.csd</citetitle></ulink>.
97
98 <example>
99 <title>Example of the readk2 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/readk2.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
105 </example>
106
107 The output should include lines like these:
108 <screen>
109 kfreq = 429.202551, kdb = -20.495694
110 kfreq = 429.202551, kdb = -20.495694
111 kfreq = 407.275258, kdb = -23.123776
112 kfreq = 475.264472, kdb = -9.300846
113 kfreq = 569.979181, kdb = -7.315527
114 kfreq = 440.103457, kdb = -0.058331
115
116 kfreq = 429.202600, kdb = -20.495700
117 kfreq = 429.202600, kdb = -20.495700
118 kfreq = 407.275300, kdb = -23.123800
119 kfreq = 475.264500, kdb = -9.300800
120 kfreq = 569.979200, kdb = -7.315500
121 kfreq = 440.103500, kdb = -0.058300
122 </screen>
123 </para>
124 </refsect1>
125
126 <refsect1>
127 <title>See also</title>
128 <para><link linkend="SigioFileIO"><citetitle>File Input and Output</citetitle></link></para>
129 </refsect1>
130
131 <refsect1>
132 <title>Credits</title>
133 <para>By: &namejohn; and &namebarry;</para>
134 <para>1999 or earlier</para>
135 </refsect1>
136 </refentry>