| 1 |
<refentry id="seqtime2"> |
| 2 |
<indexterm id="IndexSeqtime2"><primary>seqtime2</primary></indexterm> |
| 3 |
<refentryinfo><title>Instrument Control:Sensing and Control</title></refentryinfo> |
| 4 |
<refmeta> |
| 5 |
<refentrytitle>seqtime2</refentrytitle> |
| 6 |
</refmeta> |
| 7 |
|
| 8 |
<refnamediv> |
| 9 |
<refname>seqtime2</refname> |
| 10 |
<refpurpose> |
| 11 |
Generates a trigger signal according to the values stored in a table. |
| 12 |
</refpurpose> |
| 13 |
</refnamediv> |
| 14 |
|
| 15 |
<refsect1> |
| 16 |
<title>Description</title> |
| 17 |
<para> |
| 18 |
Generates a trigger signal according to the values stored in a table. |
| 19 |
</para> |
| 20 |
</refsect1> |
| 21 |
|
| 22 |
<refsect1> |
| 23 |
<title>Syntax</title> |
| 24 |
<synopsis>ktrig_out <command>seqtime2</command> ktrig_in, ktime_unit, kstart, kloop, kinitndx, kfn_times</synopsis> |
| 25 |
</refsect1> |
| 26 |
|
| 27 |
<refsect1> |
| 28 |
<title>Performance</title> |
| 29 |
<para> |
| 30 |
<emphasis>ktrig_out</emphasis> -- output trigger signal |
| 31 |
</para> |
| 32 |
|
| 33 |
<para> |
| 34 |
<emphasis>ktime_unit</emphasis> -- unit of measure of time, related to seconds. |
| 35 |
</para> |
| 36 |
|
| 37 |
<para> |
| 38 |
<emphasis>ktrig_in</emphasis> -- input trigger signal. |
| 39 |
</para> |
| 40 |
|
| 41 |
<para> |
| 42 |
<emphasis>kstart</emphasis> -- start index of looped section |
| 43 |
</para> |
| 44 |
|
| 45 |
<para> |
| 46 |
<emphasis>kloop</emphasis> -- end index of looped section |
| 47 |
</para> |
| 48 |
|
| 49 |
<para> |
| 50 |
<emphasis>kinitndx</emphasis> -- initial index |
| 51 |
</para> |
| 52 |
|
| 53 |
<note> |
| 54 |
<title>Note</title> |
| 55 |
<para> |
| 56 |
Although <emphasis>kinitndx</emphasis> is listed as k-rate, it is in fact accessed only at init-time. So if you are using a k-rate argument, it must be assigned with <link linkend="init"><citetitle>init</citetitle></link>. |
| 57 |
</para> |
| 58 |
</note> |
| 59 |
|
| 60 |
<para> |
| 61 |
<emphasis>kfn_times</emphasis> -- number of table containing a sequence of times |
| 62 |
</para> |
| 63 |
|
| 64 |
<para> |
| 65 |
This opcode handles timed-sequences of groups of values stored into a table. |
| 66 |
</para> |
| 67 |
|
| 68 |
<para> |
| 69 |
<emphasis>seqtime2</emphasis> generates a trigger signal (a |
| 70 |
sequence of impulses, see also <link |
| 71 |
linkend="trigger"><citetitle>trigger</citetitle></link> opcode), |
| 72 |
according to the values stored in the |
| 73 |
<emphasis>kfn_times</emphasis> table. This table should contain a |
| 74 |
series of delta-times (i.e. times beetween to adjacent |
| 75 |
events). The time units stored into table are expressed in |
| 76 |
seconds, but can be rescaled by means of <emphasis>ktime_unit</emphasis> argument. The |
| 77 |
table can be filled with <link |
| 78 |
linkend="GEN02"><citetitle>GEN02</citetitle></link> or by means of |
| 79 |
an external text-file containing numbers, with <link |
| 80 |
linkend="GEN23"><citetitle>GEN23</citetitle></link>. |
| 81 |
</para> |
| 82 |
|
| 83 |
<para> |
| 84 |
It is possible to start the sequence from a value different than |
| 85 |
the first, by assigning to <emphasis>initndx</emphasis> an index |
| 86 |
different than zero (which corresponds to the first value of the |
| 87 |
table). Normally the sequence is looped, and the start and end of |
| 88 |
loop can be adjusted by modifying <emphasis>kstart</emphasis> and |
| 89 |
<emphasis>kloop</emphasis> arguments. User must be sure that |
| 90 |
values of these arguments (as well as |
| 91 |
<emphasis>initndx</emphasis>) correspond to valid table numbers, |
| 92 |
otherwise Csound will crash (because no range-checking is |
| 93 |
implementeted). |
| 94 |
</para> |
| 95 |
|
| 96 |
<para> |
| 97 |
It is possible to disable loop (one-shot mode) by assigning the |
| 98 |
same value both to <emphasis>kstart</emphasis> and |
| 99 |
<emphasis>kloop</emphasis> arguments. In this case, the last read |
| 100 |
element will be the one corresponding to the value of such |
| 101 |
arguments. Table can be read backward by assigning a negative |
| 102 |
<emphasis>kloop</emphasis> value. It is possible to trigger two |
| 103 |
events almost at the same time (actually separated by a k-cycle) |
| 104 |
by giving a zero value to the corresponding delta-time. First |
| 105 |
element contained in the table should be zero, if the user intends |
| 106 |
to send a trigger impulse, it should come immediately after the |
| 107 |
orchestra instrument containing <emphasis>seqtime2</emphasis> |
| 108 |
opcode. |
| 109 |
</para> |
| 110 |
|
| 111 |
<para> |
| 112 |
<emphasis>seqtime2</emphasis> is similar to |
| 113 |
<link linkend="seqtime"><citetitle>seqtime</citetitle></link>, |
| 114 |
the difference is that when |
| 115 |
<emphasis>ktrig_in</emphasis> contains a non-zero value, current index is reset to |
| 116 |
<emphasis>kinitndx</emphasis> value. <emphasis>kinitndx</emphasis> can be varied at performance time. |
| 117 |
</para> |
| 118 |
</refsect1> |
| 119 |
|
| 120 |
<refsect1> |
| 121 |
<title>Examples</title> |
| 122 |
<para> |
| 123 |
Here is an example of the seqtime2 opcode. It uses the file <ulink url="examples/seqtime2.csd"><citetitle>seqtime2.csd</citetitle></ulink>. |
| 124 |
<example> |
| 125 |
<title>Example of the seqtime2 opcode.</title> |
| 126 |
<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> |
| 127 |
<xi:include href="examples-xml/seqtime2.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 128 |
</example> |
| 129 |
</para> |
| 130 |
</refsect1> |
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
<refsect1> |
| 158 |
<title>See also</title> |
| 159 |
<para><link linkend="ControlSensing"><citetitle>Sensing and Control: Tempo and Sequencing</citetitle></link></para> |
| 160 |
</refsect1> |
| 161 |
|
| 162 |
<refsect1> |
| 163 |
<title>Credits</title> |
| 164 |
<para>Author: &namegabriel;</para> |
| 165 |
</refsect1> |
| 166 |
</refentry> |