summaryrefslogtreecommitdiff
path: root/opcodes/readk2.xml
blob: 5138b9f662840cdf4bc7dec137dac99c6d644472 (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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<refentry id="readk2">
<indexterm id="IndexReadk2"><primary>readk2</primary></indexterm>
  <refentryinfo><title>Signal I/O:File I/O</title></refentryinfo>
  <refmeta>
    <refentrytitle>readk2</refentrytitle>
  </refmeta>

  <refnamediv>
    <refname>readk2</refname>
    <refpurpose>
      Periodically reads two orchestra control-signal values from an external file.
    </refpurpose>
  </refnamediv>

  <refsect1>
    <title>Description</title>
    <para>
      Periodically reads two orchestra control-signal values from an external file.
    </para>
  </refsect1>

  <refsect1>
    <title>Syntax</title>
    <synopsis>kr1, kr2 <command>readk2</command> ifilname, iformat, iprd</synopsis>
  </refsect1>

  <refsect1>
    <title>Initialization</title>
    <para>
      <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>.
    </para>

    <para>
      <emphasis>iformat</emphasis> -- specifies the input data format:
      <itemizedlist>
        <listitem>
          <para>1 = 8-bit signed integers (char)</para>
        </listitem>

        <listitem>
          <para>4 = 16-bit short integers</para>
        </listitem>

        <listitem>
          <para>5 = 32-bit long integers</para>
        </listitem>

        <listitem>
          <para>6 = 32-bit floats</para>
        </listitem>

        <listitem>
          <para>7 = ASCII long integers (plain text)</para>
        </listitem>

        <listitem>
          <para>8 = ASCII floats (plain text)</para>
        </listitem>
      </itemizedlist>
    </para>

    <para>
      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.
    </para>

    <para>
      <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.
      <!--unless interpolation is used.-->
    </para>


<!--    <para>
      <emphasis>interp</emphasis> - (optional) interpolate between values.
    </para>-->
<!--
    <para>
      <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.
    </para>-->
  </refsect1>

  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>kr1, kr2</emphasis> -- output of the signals read from <emphasis>ifilname</emphasis>.
    </para>

    <para>
      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.
    </para>
  </refsect1>

  <refsect1>
    <title>Examples</title>
    <para>
      See the example for <link linkend="readk"><citetitle>readk</citetitle></link>. The only difference between <link linkend="readk"><citetitle>readk</citetitle></link> and <emphasis>readk2</emphasis> is that <emphasis>readk2</emphasis> can read two values at a time from the file.
<!--      <informalexample>
        <programlisting>
knum    <emphasis>=</emphasis>         knum+1                                               ; at each k-period
ktemp   <emphasis>tempest</emphasis>   krms, .02, .1, 3, 2, 800, .005, 0, 60, 4, .1, .995   ;estimate the tempo
koct    <emphasis>specptrk</emphasis>  wsig, 6, .9, 0                                       ;and the pitch
        <emphasis>dumpk3</emphasis>    knum, ktemp, cpsoct(koct), &quot;what happened when&quot;, 8 0 ;&amp; save them
        </programlisting>
      </informalexample>-->
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="dumpk"><citetitle>dumpk</citetitle></link>,
      <link linkend="dumpk2"><citetitle>dumpk2</citetitle></link>,
      <link linkend="dumpk3"><citetitle>dumpk3</citetitle></link>,
      <link linkend="dumpk4"><citetitle>dumpk4</citetitle></link>,
      <link linkend="readk"><citetitle>readk</citetitle></link>,
      <link linkend="readk3"><citetitle>readk3</citetitle></link>,
      <link linkend="readk4"><citetitle>readk4</citetitle></link>
    </para>
  </refsect1>
  <refsect1>
    <title>Credits</title>
    <para>By: John ffitch and Barry Vercoe</para>
    <para>1999 or earlier</para>
  </refsect1>
</refentry>