Debian Codegraph @

opcodes/loop_gt.xml

raw symbols SCIP
1 <refentry id="loop_gt">
2 <indexterm id="Indexloop_gt"><primary>loop_gt</primary></indexterm>
3 <refentryinfo><title>Instrument Control:Program Flow Control</title></refentryinfo>
4 <refmeta>
5 <refentrytitle>loop_gt</refentrytitle>
6 </refmeta>
7
8 <refnamediv>
9 <refname>loop_gt</refname>
10 <refpurpose>
11 Looping constructions.
12 </refpurpose>
13 </refnamediv>
14
15 <refsect1>
16 <title>Description</title>
17 <para>
18 Construction of looping operations.
19 </para>
20 </refsect1>
21
22 <refsect1>
23 <title>Syntax</title>
24 <synopsis><command>loop_gt</command> indx, idecr, imin, label</synopsis>
25 <synopsis><command>loop_gt</command> kndx, kdecr, kmin, label</synopsis>
26 </refsect1>
27
28 <refsect1>
29 <title>Initialization</title>
30 <para>
31 <emphasis>indx</emphasis> -- i-rate variable to count loop.
32 </para>
33
34 <para>
35 <emphasis>idecr</emphasis> -- value to decrement the loop.
36 </para>
37
38 <para>
39 <emphasis>imin</emphasis> -- minimum value of loop index.
40 </para>
41
42 </refsect1>
43
44 <refsect1>
45 <title>Performance</title>
46 <para>
47 <emphasis>kndx</emphasis> -- k-rate variable to count loop.
48 </para>
49 <para>
50 <emphasis>kdecr</emphasis> -- value to decrement the loop.
51 </para>
52 <para>
53 <emphasis>kmin</emphasis> -- minimum value of loop index.
54 </para>
55 <para>
56 The actions of <command>loop_gt</command> are equivalent to the
57 code
58 <programlisting>
59 indx <emphasis role="op">=</emphasis> indx <emphasis role="op">-</emphasis> idecr
60 <emphasis role="opc">if</emphasis> (indx <emphasis role="op">&gt;</emphasis> imin) <emphasis role="opc">igoto</emphasis> label</programlisting>
61 <!-- except that the values of the <emphasis>idecr</emphasis> and
62 <emphasis>imin</emphasis> parameters cannot change in the loop; --> or
63 <programlisting>
64 kndx <emphasis role="op">=</emphasis> kndx <emphasis role="op">-</emphasis> kdecr
65 <emphasis role="opc">if</emphasis> (kndx <emphasis role="op">&gt;</emphasis> kmin) <emphasis role="opc">kgoto</emphasis> label</programlisting>
66 </para>
67 <para> <note> Adviced is to use the 'modern' while or until opcodes for looping constructions.</note>
68 </para>
69 </refsect1>
70
71 <refsect1>
72 <title>Examples</title>
73 <para>
74 Here is an example of the loop_gt opcode. It uses the file <ulink url="examples/loop_gt.csd"><citetitle>loop_gt.csd</citetitle></ulink>.
75 <example>
76 <title>Example of the loop_gt opcode.</title>
77 <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>
78 <xi:include href="examples-xml/loop_gt.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
79 </example>
80 </para>
81 </refsect1>
82
83 <refsect1>
84 <title>See also</title>
85 <para><link linkend="ControlPgmctl"><citetitle>Program Flow Control: Looping Constructions</citetitle></link></para>
86 <para> More information on this opcode: <ulink url="http://www.csoundjournal.com/2006summer/controlFlow_part2.html"><citetitle>http://www.csoundjournal.com/2006summer/controlFlow_part2.html</citetitle></ulink> written by Steven Yi,
87 and in the Floss Manuals: <ulink url="https://flossmanual.csound.com/csound-language/control-structures"><citetitle> https://flossmanual.csound.com/csound-language/control-structures</citetitle></ulink></para>
88 </refsect1>
89
90 <refsect1>
91 <title>Credits</title>
92 <para>&nameistvan;.</para>
93 <para>New in Csound version 5.01</para>
94 </refsect1>
95 </refentry>