summaryrefslogtreecommitdiff
path: root/opcodes/dumpk2.xml
blob: 0695be40e421e6ec9520a8ef8e8bcb0374696a7c (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
126
127
128
129
130
131
132
133
134
<refentry id="dumpk2">
<indexterm id="IndexDumpk2"><primary>dumpk2</primary></indexterm>
  <refentryinfo><title>Signal I/O:File I/O</title></refentryinfo>
  <refmeta>
    <refentrytitle>dumpk2</refentrytitle>
  </refmeta>

  <refnamediv>
    <refname>dumpk2</refname>
    <refpurpose>
      Periodically writes two orchestra control-signal values to an external file.
    </refpurpose>
  </refnamediv>

  <refsect1>
    <title>Description</title>
    <para>
      Periodically writes two orchestra control-signal values to a named external file in a specific format.
    </para>
  </refsect1>

  <refsect1>
    <title>Syntax</title>
    <synopsis><command>dumpk2</command> ksig1, ksig2, ifilname, iformat, iprd</synopsis>
  </refsect1>

  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>ifilname</emphasis> -- character string (in double quotes, spaces permitted) denoting the external file name. May either be a full path name with target directory specified or a simple filename to be created within the current directory
    </para>

    <para>
      <emphasis>iformat</emphasis> -- specifies the output data format:
      <itemizedlist>
        <listitem>
          <para>1 = 8-bit signed char(high order 8 bits of a 16-bit integer</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</para>
        </listitem>

        <listitem>
          <para>8 = ASCII floats (2 decimal places)</para>
        </listitem>
      </itemizedlist>
    </para>

    <para>
      Note that A-law and U-law output are not available, and that all formats except the last two are binary. The output file contains no header information.
    </para>

    <para>
      <emphasis>iprd</emphasis> -- the period of <emphasis>ksig</emphasis> output in seconds, rounded to the nearest orchestra control period. A value of 0 implies one control period (the enforced minimum), which will create an output file sampled at the orchestra control rate.
    </para>
  </refsect1>

  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>ksig1, ksig2</emphasis> -- control-rate signals.
    </para>

    <para>
      This opcode allows two generated control signal values to be saved in a named external file. The file contains no self-defining header information. But it contains a regularly sampled time series, suitable for later input or analysis. There may be any number of <emphasis>dumpk2</emphasis> opcodes in an instrument or orchestra but each must write to a different file.
    </para>
  </refsect1>

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

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

      The output should include lines like these:
      <screen>
kfreq = 429.202551, kdb = -20.495694
kfreq = 429.202551, kdb = -20.495694
kfreq = 407.275258, kdb = -23.123776
kfreq = 475.264472, kdb = -9.300846
kfreq = 569.979181, kdb = -7.315527
kfreq = 440.103457, kdb = -0.058331

kfreq = 429.202600, kdb = -20.495700
kfreq = 429.202600, kdb = -20.495700
kfreq = 407.275300, kdb = -23.123800
kfreq = 475.264500, kdb = -9.300800
kfreq = 569.979200, kdb = -7.315500
kfreq = 440.103500, kdb = -0.058300
      </screen>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="dumpk"><citetitle>dumpk</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="readk2"><citetitle>readk2</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>