Debian Codegraph @

opcodes/timeinstk.xml

raw symbols SCIP
1
2 <refentry id="timeinstk">
3 <indexterm id="IndexTimeinstk"><primary>timeinstk</primary></indexterm>
4 <refentryinfo><title>Instrument Control:Time Reading</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>timeinstk</refentrytitle>
7 </refmeta>
8
9 <refnamediv>
10 <refname>timeinstk</refname>
11 <refpurpose>
12 Read absolute time in k-rate cycles.
13 </refpurpose>
14 </refnamediv>
15
16 <refsect1>
17 <title>Description</title>
18 <para>
19 Read absolute time, in k-rate cycles, since the start of an
20 instance of an instrument. Called at both i-time as well as
21 k-time. NB: the returned value at k-time starts at 1
22 </para>
23 </refsect1>
24
25 <refsect1>
26 <title>Syntax</title>
27 <synopsis>kres <command>timeinstk</command></synopsis>
28 </refsect1>
29
30 <refsect1>
31 <title>Performance</title>
32 <para>
33 <emphasis>timeinstk</emphasis> is for time in k-rate cycles. So with:
34
35 <informalexample>
36 <programlisting>
37 <emphasis role="opc">sr</emphasis> <emphasis role="op">=</emphasis> 44100
38 <emphasis role="opc">kr</emphasis> <emphasis role="op">=</emphasis> 6300
39 <emphasis role="opc">ksmps</emphasis> <emphasis role="op">=</emphasis> 7</programlisting>
40 </informalexample>
41
42 then after half a second, the <emphasis>timeinstk</emphasis> opcode would report 3150. It will always report an integer.
43 </para>
44
45 <para>
46 <emphasis>timeinstk</emphasis> produces a k-rate variable for output. There are no input parameters.
47 </para>
48
49 <para>
50 <emphasis>timeinstk</emphasis> is similar to <link linkend="timek"><citetitle>timek</citetitle></link> except it returns the time since the start of this instance of the instrument.
51 </para>
52 </refsect1>
53
54 <refsect1>
55 <title>Examples</title>
56 <para>
57 Here is an example of the timeinstk opcode. It uses the file <ulink url="examples/timeinstk.csd"><citetitle>timeinstk.csd</citetitle></ulink>.
58
59 <example>
60 <title>Example of the timeinstk opcode.</title>
61 <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>
62 <xi:include href="examples-xml/timeinstk.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
63 </example>
64
65 Its output should include lines like this:
66 <screen>
67 k1 = 1.000000 samples
68 k1 = 2205.000000 samples
69 k1 = 4410.000000 samples
70 k1 = 6615.000000 samples
71 k1 = 8820.000000 samples
72 </screen>
73 </para>
74 </refsect1>
75
76 <refsect1>
77 <title>See also</title>
78 <para><link linkend="ControlTimeread"><citetitle>Time Reading</citetitle></link></para>
79 </refsect1>
80
81 <refsect1>
82 <title>Credits</title>
83 <para>
84 <simplelist>
85 <member>Author: Robin Whittle</member>
86 <member>Australia</member>
87 <member>May 1997</member>
88 </simplelist>
89 </para>
90 <para>Example written by &namekevin;.</para>
91 </refsect1>
92 </refentry>