| 1 | |
| 2 | <refentry id="dumpk2"> |
| 3 | <indexterm id="IndexDumpk2"><primary>dumpk2</primary></indexterm> |
| 4 | <refentryinfo><title>Signal I/O:File I/O</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>dumpk2</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>dumpk2</refname> |
| 11 | <refpurpose> |
| 12 | Periodically writes two orchestra control-signal values to an external file. |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | Periodically writes two orchestra control-signal values to a named external file in a specific format. |
| 20 | </para> |
| 21 | </refsect1> |
| 22 | |
| 23 | <refsect1> |
| 24 | <title>Syntax</title> |
| 25 | <synopsis><command>dumpk2</command> ksig1, ksig2, ifilname, iformat, iprd</synopsis> |
| 26 | </refsect1> |
| 27 | |
| 28 | <refsect1> |
| 29 | <title>Initialization</title> |
| 30 | <para> |
| 31 | <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 |
| 32 | </para> |
| 33 | |
| 34 | <para> |
| 35 | <emphasis>iformat</emphasis> -- specifies the output data format: |
| 36 | <itemizedlist> |
| 37 | <listitem> |
| 38 | <para>1 = 8-bit signed char(high order 8 bits of a 16-bit integer</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</para> |
| 55 | </listitem> |
| 56 | |
| 57 | <listitem> |
| 58 | <para>8 = ASCII floats (2 decimal places)</para> |
| 59 | </listitem> |
| 60 | </itemizedlist> |
| 61 | </para> |
| 62 | |
| 63 | <para> |
| 64 | 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. |
| 65 | </para> |
| 66 | |
| 67 | <para> |
| 68 | <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. |
| 69 | </para> |
| 70 | </refsect1> |
| 71 | |
| 72 | <refsect1> |
| 73 | <title>Performance</title> |
| 74 | <para> |
| 75 | <emphasis>ksig1, ksig2</emphasis> -- control-rate signals. |
| 76 | </para> |
| 77 | |
| 78 | <para> |
| 79 | 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. |
| 80 | </para> |
| 81 | </refsect1> |
| 82 | |
| 83 | <refsect1> |
| 84 | <title>Examples</title> |
| 85 | <para> |
| 86 | Here is an example of the dumpk2 opcode. It uses the file <ulink |
| 87 | url="examples/dumpk2.csd"><citetitle>dumpk2.csd</citetitle></ulink>. Note |
| 88 | that the example must be run from a directory for which the |
| 89 | user has write access. |
| 90 | |
| 91 | <example> |
| 92 | <title>Example of the dumpk2 opcode.</title> |
| 93 | |
| 94 | |
| 95 | |
| 96 | <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> |
| 97 | <xi:include href="examples-xml/dumpk2.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 98 | </example> |
| 99 | |
| 100 | The output should include lines like these: |
| 101 | <screen> |
| 102 | kfreq = 429.202551, kdb = -20.495694 |
| 103 | kfreq = 429.202551, kdb = -20.495694 |
| 104 | kfreq = 407.275258, kdb = -23.123776 |
| 105 | kfreq = 475.264472, kdb = -9.300846 |
| 106 | kfreq = 569.979181, kdb = -7.315527 |
| 107 | kfreq = 440.103457, kdb = -0.058331 |
| 108 | |
| 109 | kfreq = 429.202600, kdb = -20.495700 |
| 110 | kfreq = 429.202600, kdb = -20.495700 |
| 111 | kfreq = 407.275300, kdb = -23.123800 |
| 112 | kfreq = 475.264500, kdb = -9.300800 |
| 113 | kfreq = 569.979200, kdb = -7.315500 |
| 114 | kfreq = 440.103500, kdb = -0.058300 |
| 115 | </screen> |
| 116 | </para> |
| 117 | </refsect1> |
| 118 | |
| 119 | <refsect1> |
| 120 | <title>See also</title> |
| 121 | <para><link linkend="SigioFileIO"><citetitle>File Input and Output</citetitle></link></para> |
| 122 | </refsect1> |
| 123 | |
| 124 | <refsect1> |
| 125 | <title>Credits</title> |
| 126 | <para>By: &namejohn; and &namebarry;</para> |
| 127 | <para>1999 or earlier</para> |
| 128 | </refsect1> |
| 129 | </refentry> |