Debian Codegraph @

opcodes/readk4.xml

raw symbols SCIP
1
2 <refentry id="readk4">
3 <indexterm id="IndexReadk4"><primary>readk4</primary></indexterm>
4 <refentryinfo><title>Signal I/O:File I/O</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>readk4</refentrytitle>
7 </refmeta>
8
9 <refnamediv>
10 <refname>readk4</refname>
11 <refpurpose>
12 Periodically reads four orchestra control-signal values from an external file.
13 </refpurpose>
14 </refnamediv>
15
16 <refsect1>
17 <title>Description</title>
18 <para>
19 Periodically reads four orchestra control-signal values from an external file.
20 </para>
21 </refsect1>
22
23 <refsect1>
24 <title>Syntax</title>
25 <synopsis>kr1, kr2, kr3, kr4 <command>readk4</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, kr3, kr4</emphasis> -- output of the signals read from <emphasis>ifilname</emphasis>.
86 </para>
87
88 <para>
89 This opcode allows four 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 four "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>readk4</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 readk4 opcode. It uses the file <ulink url="examples/readk4.csd"><citetitle>readk4.csd</citetitle></ulink>.
97
98 <example>
99 <title>Example of the readk4 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/readk4.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
105 </example>
106
107 The output should include lines like these:
108 <screen>
109 WRITING:
110 kcf = 1122.469723, kq = 11.762839, kdb = -14.313445, kpan = 0.538142
111 kcf = 1122.469723, kq = 11.762839, kdb = -14.313445, kpan = 0.538142
112 kcf = 1148.638412, kq = 12.040490, kdb = -14.061868, kpan = 0.552205
113 kcf = 165.796855, kq = 18.523179, kdb = -15.816977, kpan = 0.901528
114 kcf = 147.729960, kq = 13.071911, kdb = -11.924531, kpan = 0.982518
115 kcf = 497.430113, kq = 13.605512, kdb = -21.586611, kpan = 0.179229
116
117 READING:
118 WARNING: Seeding from current time 3308160476
119
120 kcf = 1122.469700, kq = 11.762800, kdb = -14.313400, kpan = 0.538100
121 kcf = 1122.469700, kq = 11.762800, kdb = -14.313400, kpan = 0.538100
122 kcf = 1148.638400, kq = 12.040500, kdb = -14.061900, kpan = 0.552200
123 kcf = 165.796900, kq = 18.523200, kdb = -15.817000, kpan = 0.901500
124 kcf = 147.730000, kq = 13.071900, kdb = -11.924500, kpan = 0.982500
125 kcf = 497.430100, kq = 13.605500, kdb = -21.586600, kpan = 0.179200
126 </screen>
127 </para>
128 </refsect1>
129
130 <refsect1>
131 <title>See also</title>
132 <para><link linkend="SigioFileIO"><citetitle>File Input and Output</citetitle></link></para>
133 </refsect1>
134
135 <refsect1>
136 <title>Credits</title>
137 <para>By: &namejohn; and &namebarry;</para>
138 <para>1999 or earlier</para>
139 </refsect1>
140 </refentry>